Skip to content

Instantly share code, notes, and snippets.

@josemvidal
Created October 5, 2012 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josemvidal/3840034 to your computer and use it in GitHub Desktop.
Save josemvidal/3840034 to your computer and use it in GitHub Desktop.
Bookmarklet Code
<p>Grab our <a id="bookmarklet" href="">Pin It</a> bookmarklet and put it on your bookmarks bar.</p>
<!-- The script below sets the href above with the correct host, so it'll work both on localhost:8080
and on the real host. -->
<script>
link = document.getElementById('bookmarklet');
link.href = "javascript:(function(){ _my_script=document.createElement('SCRIPT');_my_script.type='text/javascript';_my_script.src='http://"
+ location.host + "/js/bookmarklet.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_my_script);})();"
</script>
@prabhat1992
Copy link

you are awesome

@jingyansu
Copy link

How do i put link in this code? Please tell me, how can i use this code to create a bookmarklet. Thanks

@kpaka001
Copy link

sus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment