WordPress.org

Ready to get started?Download WordPress

Forums

Insert a non-http link into WordPress (5 posts)

  1. veggieboy4000
    Member
    Posted 5 years ago #

    I would like to add a bookmarklet into my wordpress.com blog. A bookmarklet is a JavaScript "link" that instead of opening a new website it calls a JS function.

    The link would be something like this: "javascript:function foo()". However, both editors - visual and HTML - scrub out the javascript bit and replace it with "http://".

    Is there a way to turn this off and insert the non-http text manually?

    Thanks!

  2. stvwlf
    Member
    Posted 5 years ago #

    I just tried what you attempted to do and it worked fine in both visual and html editors. It did wrap my link in <p></p> but the javascript part did not have http:// inserted. 2.7.1

    Don't know what to suggest to you other than try again.

  3. veggieboy4000
    Member
    Posted 5 years ago #

    Thanks for your response. Are you using wordpress on your own server or wordpress.com? Could be that wordpress.com has a more aggressive JS filter to avoid cross site scripting and other shenanigans.

  4. stvwlf
    Member
    Posted 5 years ago #

    Oh, I'm sorry, I didn't notice you were referring to wordpress.com. This forum really is for self-hosted WordPress.

  5. Saurus
    Member
    Posted 5 years ago #

    I believe wp.com prohibits the use of javascripts.

Topic Closed

This topic has been closed to new replies.

About this Topic