Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Does anyone know how to publish your own bookmarklet in a blog like wordpress or blogger? All of them seem to format the bookmarklet removing the javascript or messing it up.

E.g., pasting this in wordpress blog:

<a href="javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){$.hide()});" title="Run"></a>

results in

<a href="//ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){$.hide()});">Run jQuery Code</a>
share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

Create a clickable link on http://jsfiddle.net/ and link to it.

share|improve this answer
    
Ended up using this approach. Marking it as answer as this is closest. Here's the blog post: hkpanda.posterous.com/web-20-pop-up-blocker –  Mrchief May 2 '11 at 21:41
add comment

WordPress.com does not allow to post JavaScript.

You should follow instruction on posting source code or put it on externals snippets service (such as Gist for example) and link to it.

Unfortunately neither will do as active clickable bookmarklet link.

share|improve this answer
add comment

Most visual editors will attempt to format your code. If wrapping it in the <code> </code> tags doesn't work, attempt this plugin http://wordpress.org/extend/plugins/inline-javascript/

share|improve this answer
    
WP.com question, no plugins. :) –  Rarst May 2 '11 at 14:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.