• Hi,
    I’ve googled this problem and also checked out the codex page for javascript and that wasn’t much help either (I’m a WordPress beginner). Sometimes I’m not sure if the advice if for me or for plugin/theme developers.

    What I am looking for is the ability to have an external javascript file (scriptname.js) on my server which contains all the javascript functions I’ll be using in my post. Then I want to be able to create a post which uses these functions.

    After lots of trial and error I was able to get some of the javascript working, but not the rest. It works 100% when I test it locally. I’m using the “Custom fields shortcode” plugin and then using a customfield [cf]js[/cf] to access the javascript code. This may not be a good way to do it, but it’s the only way I’ve been able to get working so far. If there’s a better way, please tell me 🙂

    If you look at the page http://www.arbzilla.com/category/free-arb-bets/ you will see that the border rollover effects work fine, but in step 4, the “recalculate” button does nothing, even though it has events attached to it (onMouseOver=”highlight_button()” onMouseOut=”unhighlight_button()” onclick=”click_recalculate_button()”).

    Is there an easy step-by-step way to allow me to create posts that make use of my external javascript file?

    Thanks 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter arbzilla

    (@arbzilla)

    Update: I’ve been using firefox for all my testing. When I tested using google chrome and internet explorer….it worked! I didn’t think to test in a different browser, sorry. I have no idea why it isn’t working in firefox, is it just on my computer or is it on all firefox browsers?

    Anyway, my original question still stands, I’m still looking for a good way to get javascript working in posts. There must be a standard way that most people use successfully, right?

Viewing 1 replies (of 1 total)

The topic ‘Javascript not working in posts’ is closed to new replies.