Seriously? there is not even one person that knows how wordpress works?
DO you need more information?
C’mon guys, it’s been a week.
Review Using_Javascript. If you continue to have problems then the issue is within your JavaScript – not WordPress.
Thanks esmi,
I have read that page before I posted the first request and that’s where I got wp_enqueue_script() and add_action() from. I also read the external links to http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/ but
One thing I forgot was to include the version number of the word press that the client is using – WP 3.0.3,
I have installed the 3.2.1 on my server at http://word.atcentre.com/ and it works OK.
Should i still review that page, or is there something I need to change in wordpress 3.0.3 on the client sites, they have 11 instances of 3.0.3 running?
Thanks for the reply
Bogdan
WP 3.0.3 uses an older version of jQuery compared to 3.2.1.
You’re not dealing with a WordPress or a jQuery problem. You’re dealing with an IE JavaScript problem.
The issue is being caused by IE not firing your onload event attached to the body tag. Without editing your code, I can’t verify why. I can verify that that’s the point of failure though, because in IE you can load your site, go to Tools > Developer Tools > Script Tab. Run getData(); in the console, and your header loads fine.
Based on that, I know that the function runs in IE, it’s just not being called. Your most likely solution will be to get rid of the onload attribute on your <body> tag, and instead call getData() from inside your jQuery(document).ready block in jumpBar.js. That should solve it, since getData() runs fine when your select elements are changed in IE, which means your jQuery ready event is being fired.
If that doesn’t work, Google around for articles related to Internet Explorer onload failure.
Thanks pdclark
That worked OK, and I include the code for posterity.
I had a doc.ready section but only fired on select (any select)
so i just commented the jQuery(“select”).change(function(){ and related });
———————
jQuery(document).ready(function(){
// Location Selector
// jQuery(“select”).change(function(){
getData();
// });
});
It even seem to load sooner than last time.
All that said, why the onload worked fine in (IE) on WP-3.2.1 and and on stand alone pages as well but not in WP-3.0.3? Rhetorical question, don’t expect the answer, i am happy it works ……
Thanks Again
Bogdan
You’re correct that it does load faster.
OnLoad fires when all HTML, CSS, JavaScript, Images, etc are completely done loading.
DOMReady, the event that drives jQuery(document).ready(), fires as soon as HTML is loaded and ready to be manipulated by JavaScript.
Mostly because of images, onLoad fires much later than DOMReady, and in almost every circumstance, DOMReady is preferred.
Sorry for confusion in this post but I have to make a correction to it, just in case some one else is looking at the same issues.
Getting the onload into jQuery itself did not fix the problem with IE not loading. I only found that after trying to deploy on other sites. But I still left the doc.ready as a better option
jQuery(document).ready(function(){
getData();
});
What I had to do to fix the not loading IE issues was ……
deregister and register a new version of jQuery. code below.
<?php
wp_deregister_script( ‘jquery’ );
wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js’);
wp_enqueue_script( ‘jquery’ );
wp_enqueue_script(‘jumpMenu’, ‘http://iventurecard.com/_jumpMenu/jumpBar.js’);
add_action(‘jumpMenu’, ‘getData’);
?>
I hope this helps some one,
Thank you all for help
Cheers
Bogdan