WordPress.org

Ready to get started?Download WordPress

Forums

Javascript in a post/page (3 posts)

  1. emielvenlo
    Member
    Posted 1 year ago #

    I have a link from an payment provider where some html and javascript is mixed. The problem is that this line dissapears sometimes when someone is editing the page. I think (but am not sure) that this happens when using wysiwig.

    This is the code that i want to use in the page:

    <script src="https://www.targetpay.com/send/include.js"> </script>
    
    <a href="javascript: targetpay(11111, 11111, 'auto', 'auto', '');">Betaalde download</a>

    I want it to be so that allso when someone would use the wysywig, the link will stay intact. I have tried two things:
    Using the tags from: http://codex.wordpress.org/Using_Javascript
    and using this plugin: http://wordpress.org/extend/plugins/allow-javascript-in-posts-and-pages/
    But the problem with both is, that the html and javascript is mixed, and in alle the way's i have tried it, it does not work...

    Does anyone know the solution?

  2. emielvenlo
    Member
    Posted 1 year ago #

    I tried a lot of things the past week, but could not resolve it yet. Anyone any ideas?

  3. Sabinou
    Member
    Posted 1 year ago #

    This isn't an actual solution, more like "cheating", but how about you use shortcodes to load the javascript's contents ?

    It seems the WYSIWYG editor hates your javascript. Right.

    But if you use a shortcode that will load inside your post the contents of the script, it should work, the editor couldn't break it, I think...

    I don't know if this won't cause a problem, to use a shortcodes plugin (like shortcoder : http://wordpress.org/extend/plugins/shortcoder/ , I'm using it and it works flawlessly, but in my case it's for simple HTML code) in association with a plugin making javascript to fully work, though. That would be yours for testing :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags