Fun with JavaScript bookmarks
Here are some random JavaScript sinippets I wrote for bookmarks.
How they work is when you click the bookmark, the JavaScript is executed. So you can actually do a bit of programming inside a browser bookmark.
How to save JavaScript bookmarks:
- Copy the Bookmarks JavaScript code
- Right Click on the bookmark toolbar
- Choose “new bookmark” or the equivalent on your browser
- Fill in a name of choice
- In the location/url field paste the javascript code
javascript:window.location='http://www.google.com/translate_c?u='+window.location
javascript:void(alert(eval(prompt('Calculate:'))))
javascript:str='';i=0;c=prompt('Encode in Binary:');while(n=c.charCodeAt(i)){ b = '';while(n>0) { b = (n&1 ? '1' : '0')+b; n >>= 1; } i++;str+=b+' ' } void(alert(str))
Related posts:
- Monster - 3d in JavaScript I was reading the Qt blog’s on Webkit when I came aross this post on the chrome experiment Monster. The...
- Base conversion in JavaScript I just realized recently that you can convert between number bases in JavaScript using the built in method Object.prototype.toString() and...
- JavaScript Regex match all characters JavaScript regular expressions (browser) do not have a modifier allowing the dot (.) to match all characters including the newline...
- ASCII to Hex in JavaScript This JavaScript will add a method to the String object, that converts the ASCII string to a hex string consisting...