Social Media Magazine

Javascript Bookmarklet Create Javascript Bookmarklet in Google Chrome

Posted on the 29 January 2017 by Pro Webguru @prowebguru

You might have seen some of the popular sites providing you an option of bookmarklet, which you can drag to your favorites bar and after clicking on that it will perform some operation like opening a new window with pre populated information or performing something on current screen.

It is easy to create javascript bookmarklets, in which you can write your custom javascript code to perform some functions.

I will show you how to create simple bookmarklet in different browsers.

On clicking of this bookmarklet, we will just display some information in alert. This is just a kind of "Hello World" bookmarklet for those who don't have idea about it. Same can be extended to implement more complex operations.

We will use following javascript code for this.

alert("Hi, How are you ?");

Let's start!

How to Create Javascript Bookmarklet in Google Chrome ?

  1. To create a bookmarklet in google chrome, make sure your favorites bar is visible on screen.
  2. Right click on favorites bar and click on "Add Page..." option.
  3. It will show following screen
  4. In the Name tab, enter the name of your bookmark.
  5. Now in URL part we will put our Javascript code prepended by "javascript:" and we will create a simple function which we will call.
  6. So now our final URL will be javascript:function test() {alert('Hi, How are you ?');} test();
  7. Click Save and we are done.

We have just created our first javascript bookmarklet in javascript.

Same method can be used to do some complex processing like creating forms for submission of information for a website, do some analysis on webpage like finding email addresses from webpage, finding urls from webpage with this simple javascript code.

Tell me if you can use it to create some kind of useful stuff for your use.

Check Javascript Function to Replace All Occurances of String

You Might Also Like :

Back to Featured Articles on Logo Paperblog

These articles might interest you :

  • Hop Scotch


    Now there’s a touch of spring in the air, it’s time to resume with my travels, starting with a trip into the Kingdom of Fife for three of the matches in the... Read more

    The 18 March 2018 by   Smidrophenia
  • Bubble Guppies Live Review

    Bubble Guppies Live Review

    One night about a month and a half ago I was doing some work for my theater company, posting information about our upcoming production to various listings... Read more

    The 18 March 2018 by   Nesheaholic
  • Is There a Sting in the Tail?

    There Sting Tail?

    I often say that whilst I love snowdrops I am not a galanthophile and nor will I ever be one.  Overwhelmingly the snowdrops in my garden are the common nivalis... Read more

    The 18 March 2018 by   Ozhene
  • Astaberry Skin Whitening Face Wash Review

    Astaberry Skin Whitening Face Wash Review

    We all know Astaberry Biosciences as they are the leading manufacturer of Ayurvedic cosmetics. Recently they have introduced a new product known as “Skin... Read more

    The 18 March 2018 by   Jayshreebhagat
  • Sixer’s Soapbox: Preston Comfortable as Sunderland Freezes

    Sixer’s Soapbox: Preston Comfortable Sunderland Freezes

    John McCormick writes: I won’t be going to the North-East before June, so I won’t be seeing any home games this season. Just as well, I suppose, as the text... Read more

    The 18 March 2018 by   Colin Randall
  • Schindler’s Lift

    Schindler’s Lift

    Following a boozy afternoon on the tiles, I had no memory of making it back to our hotel in East London. This is despite staggering from Soho to Piccadilly... Read more

    The 18 March 2018 by   Jackscott
  • Electric Universe - Yamnaya People - proto-Saturnian-split Date?

    Electric Universe Yamnaya People proto-Saturnian-split Date?

    THERE WERE GIANTS IN THOSE DAYS:yes, this looks like Free Planet taking the Bible as a Historical Document...The Electric Universe concept (ameliorated by... Read more

    The 18 March 2018 by   Freeplanet