1

I have a blog on wordpress.com and would like to post a bookmarklet I have written there. However, wordpress.com breaks the URL string. Is there any way I can post it?

For example, if I enter a link in HTML view as

<a href="javascript:alert('dog')">Hi</a>

when I press publish the link is changed to:

http://myblog.wordpress.com/alert(%27dog%27)
4

JavaScript is not allowed on wordpress.com blogs due to security reasons. This means that the following will not work (among others): <script> tags; javascript: links; and events such as onclick.

In fact, that's the reason I switched from wordpress.com to blogger.com. Your only Wordpress option is to either host it yourself, or find some hosting solution that allows JavaScript.

If you decide to host it yourself, JavaScript will work out of the box (tested on latest version only), and you can find more information here.

If for some reason you cannot use JavaScript with your hosting, you could try to see if it supports the Inline JavaScript Plugin [via], which will enable JavaScript. Wordpress.com does not support this plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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