Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Functional IMG Button

    Is there anyway to make a button like this in html/javacript



    The button is supposed to function the same way the pinterest "Pin It" button functions.


    Here's the code for it:

    Code:
    javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://snatchly-assets-uncompressed.s3.amazonaws.com/scripts/snatchly.bookmarklet.min.js?r='+Math.random()*99999999);document.body.appendChild(e)})());
    Your supposed to bookmark this code to be able to pin items from any page. I'm trying to make a clickable button for my website.

    Anyone have an idea on how I can go about doing this?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by unify View Post
    Anyone have an idea on how I can go about doing this?

    Code:
    <img src="http://i654.photobucket.com/albums/uu265/hoover78/hrfj.png" border="0" alt="" onclick = "go()"/>
    
    <script type = "text/javascript">
    
    function go() {
    javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://snatchly-assets-uncompressed.s3.amazonaws.com/scripts/snatchly.bookmarklet.min.js?r='+Math.random()*99999999);document.body.appendChild(e)})());
    }
    </script>

    Quizmaster: What measurement is equal to 6,076 feet?
    Contestant: A yard.
    Last edited by Philip M; 11-02-2012 at 09:35 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •