i understand that javascript does not work well with wordpress
Not true. See http://codex.wordpress.org/Using_Javascript
Hi Esmi
thanks for replying so quickly
I have already tried that method you showed
it showed the same problem as before the javascript was still disabled
most likely I’m doing something wrong here
Phil
(@owendevelopment)
Have you tried this in a blank html page? Does it work there?
If so, there could be Javascript scripts used in the theme that cause conflicts. If this is the case, look into ‘Javascript no conflict’ in Google for resetting the function $ before the new script gets called.
Are you enqueuing your script correctly?
HI PSM
yes it does work in a blank html page
hmm ill look into no conflict
Esmi
I’m not 100% sure i know what that means but if you meant placing the script in the php files of the template
then i didnt do that i was trying to avoid that as i only needed this javascript to work on one specific page
i tried placing a javascript file and then using the call to script/ call to javascript command
btw apologies as im a super n00b to javascript i really try to avoid using it
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
You could use an is_page() conditional on the add_action to ensure that the script is only loaded on a specific page.