How To Make a Bookmarklet For Your Web Application

@Chris: Cool, whatever way it helps :).

Hi Kalid,

Thanks again. Here’s the what your post led to…

http://restream.me/bookmarklets

-Chris

@Chris: Awesome, glad it helped!

Excellent tutorial. This came in very handy.

One thing you might want to mention is that window.open() code will be blocked in imported scripts since its added to the page. However, the same code directly in the bookmarklet will not get blocked since it is considered trusted.

How To Make a Bookmarklet For Your Web Application | BetterExplained…

[…] How To Make a Bookmarklet For Your Web Application | BetterExplained (tags: bookmarklets bookmarklet programming tutorial web2.0) […]

Handy article - was discussing Bookmarklets the other day for an application.

Maybe direct javascript works fine but I don’t like the 2000 characters limit. It’s such a pity - let’s use something dynamic.

Very useful post - instead of using var[space] you can actually create variables by passing them into the arguments of the function (variable a), or by overwriting the argument (variable b):

javascript:(function(a,b){b=a.style;})(document.createElement(“iframe”))

[…] a lot to this awesome tutorial on how to make a bookmarklet blog comments powered by Disqus var disqus_url = […]

[…] to create a browser bookmarklet which does a POST request. There is a huge amount of information on how to make a bookmarklet, but I finally swiped code from Smart Bookmarks and Bookmarklets, which provided just what I was […]

[…] big ups to this Japanese site for its help. And this English one, and finally to this forum for debugging […]

This is Really useful . Thanks!

[…] of JavaScript saved into a bookmark that act like simple browser plugins. BetterExplained’s How To Make a Bookmarklet For Your Web Application is an excellent introduction. Opera and Google Chrome browsers do not currently offer functionality […]

@Brunner: Yes, I prefer the dynamic approach for easier debugging & better flexibility (can change the code on the server).

@Adam: Neat trick! Yep, that works too.

@Mark: You’re welcome!

[…] How To Make a Bookmarklet For Your Web Application | BetterExplained – […]

[…] How To Make a Bookmarklet For Your Web Application | BetterExplained (tags: bookmarklet) […]

The crunchinator based approach is not the best for bookmarklets. It breaks when you try to convert a script containing a modulo like this:

var a= 33;
a=a % 32;
alert(a);

It results in:
javascript:(function(){var a=17;a=(a2);alert(a);})();

The crunchinator strips whitespaces, so % 32 becomes %32 what is the escape sequence for the number 2. That will lead to wrong results if you paste it into the address bar (clicking on a bookmarklet is the same as pasting)

[…] Swaminathan 3 votes by Peter Clark, Jared Grippe and Jim BrockKalid has a blog post on it: http://betterexplained.com/artic...Insert a dynamic date hereCannot add comment at this time.  Jared Grippe notable […]

@QuHno: Ah, great catch. One more reason to just load the script dynamically.