Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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)
share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

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.