I Want to create a bookmark that when clicked, runs a piece of javascript and adds an image on the page
Can anybody point me in the direction of how to go about doing this?
I want to write a script that I can bookmark, so that when its clicked, this image ‘http://www.dannemann.com/images/lensflarePhilosophy.png’ appears on the page
Tried this with no luck
javascript:var img=document.createElement('img');img.src='http://www.dannemann.com/images/lensflarePhilosophy.png';body.appendChild(img);
You can do that something like this:
For bookmark, make sure to put
javascript:before above code and compress it with JS minifier/compresser.Once compressed, you need to put
javascript:before it and save in bookmarks/bookmarks toolbar, here is it expressed: