Javascript bookmarklet tutorial

I this Javascript bookmarklet tutorial, you’ll find out that creating Javascript bookmarklet is easier than you may think. More easier than that.

TL;DR

Create a bookmark called Hello!, then set the URL to javascript:alert(“Hello!”);. Done.

Javascript bookmarklet tutorial

To have a scope where you can put numerous statements, declare a self invoking function.

javascript:
(
	function()
	{
		var message = "Hello!";
		alert(message);
	}
)();

There you go, there is not much more than TL;DR.

DISCLAIMER. THE INFORMATION ON THIS BLOG (INCLUDING BUT NOT LIMITED TO ARTICLES, IMAGES, CODE SNIPPETS, SOURCE CODES, EXAMPLE PROJECTS, ETC.) IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE INFORMATION ON THIS BLOG (INCLUDING BUT NOT LIMITED TO ARTICLES, IMAGES, CODE SNIPPETS, SOURCE CODES, EXAMPLE PROJECTS, ETC.).