Reputation: 11095
I am trying to deploy my bookmarklet in public, but I am not sure what is the best way to do it. Suppose I have,
javascript:(function(){console.log("hello");}())
And I make it draggable to the bookmarklet by enclosing it within a href tag. The trouble is that HTML special characters are encoded like %07d
for the above snippet. What's the conventional way to solve this problem?
Thank you!
Upvotes: 0
Views: 157
Reputation: 59232
It should work fine, till it is in the following format.
<a href="javascript:(function(){alert('hello');}())">Bookmarklet</a>
Note: I changed console.log()
to alert()
to make the result view able immediately.
Live Demo: http://jsfiddle.net/qyL4L/
Upvotes: 1