Note: The code in the video does not set the host properly. Use the code below for your bookmarklet:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Notice that I updated this post. The video is wrong.
ReplyDelete