Buca Bay - Always nice

Dua tiko noqu toa loaloa, na yacana ko… laga mai…

Fun with JavaScript bookmarks

July15

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:

  1. Copy the Bookmarks JavaScript code
  2. Right Click on the bookmark toolbar
  3. Choose “new bookmark” or the equivalent on your browser
  4. Fill in a name of choice
  5. In the location/url field paste the javascript code
Here is the list:
Translator:

javascript:window.location='http://www.google.com/translate_c?u='+window.location
Calculator:
javascript:void(alert(eval(prompt('Calculate:'))))
Binary Convertor:
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:

  1. 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...
  2. 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...
  3. JavaScript Regex match all characters JavaScript regular expressions (browser) do not have a modifier allowing the dot (.) to match all characters including the newline...
  4. 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...
posted under web development

Email will not be published

Website example

Your Comment:

 
Tag Cloud