Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Javascript Errors Causing Problems
- This topic has 12 replies, 3 voices, and was last updated 13 years, 9 months ago by amin007.
-
AuthorPosts
-
February 4, 2011 at 1:35 pm #1417ericgallagherMember
I just tried a new theme and had problems with one of the widgets that came with the theme. Contacted the author and here is what he said
It appears that the problem is caused by a number of Javascript errors which stops the jQuery from working. I suggest you disable your plugins and enable them one-by-one to see which one is causing the conflict.
I did what he said and found that it was the WP eStore that was causing the problems.
My site is [www.preparedcatholic.com]
Typically I would find a work around for the widget, but by his explanation, this could be a big problem down the road.
February 5, 2011 at 2:50 am #28707amin007ParticipantThere is no JavaScript errors in eStore plugin. I just checked your page source and found out that the theme is including an older verison (v1.3.2) of JQuery library!!!
http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
WordPress 3.0 ships with the latest version of JQuery library which every plugin and theme should try to use or at least use the same version from Google. This is what eStore tryies to do but since your theme developer haven’t updated the theme it only works for this older version so its conflicting.
Also, it is a good idea to use the “wp_enqueue_script” function to load the JQuery library that ships with WordPress as it runs in noConflict mode by default which saves all these conflict hassles (more details on the WordPress site):
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Remember, there are a lot of plugins and themes that use JQuery and eStore runs fine with them.
Once, the theme is successfully running on JQuery 1.4.2 (the latest as of now) let me know and if you still have an issue with eStore and I will look into it.
February 5, 2011 at 8:49 pm #28708ericgallagherMemberAm having the same problems with this one. I also had the author help me update to the current on the other theme and we have the same problems. Please check new theme.
[http://preparedcatholic.com/]
February 6, 2011 at 3:22 am #28709amin007ParticipantThis theme is doing the same (its using the old version of JQuery v1.3.2)
<script type=’text/javascript’ src=’http://preparedcatholic.com/wp-content/themes/LondonLive/scripts/js/jquery.min.js?ver=3.0.4′></script>
I am not sure why the developer specified this version to be “3.0.4” because thats not out on the official JQuery site yet. Anyway, I took a look inside the script as the script usually has the version number on it. The above code is including the following file:
[http://preparedcatholic.com/wp-content/themes/LondonLive/scripts/js/jquery.min.js?ver=3.0.4]
If you click on the above link it will open the file in the browser. Now, look at the top and read the version number. You will see that the actuall JQuery version is 1.3.2!
I don’t understand why the theme is including it’s own version of JQuery in the first place. It needs to use the one given by WordPress!
February 6, 2011 at 3:41 am #28710ericgallagherMemberI know you are not the one who should be giving me this, but can you give me what I need to draw the JQuery from WordPress? I could not translate the WordPress language you gave me previously for help. I am finding a lot of themes that do this and you seem like a good one to ask.
February 6, 2011 at 10:23 pm #28711ericgallagherMemberHe got me updated to 1.5 and still same problems.
February 7, 2011 at 3:22 am #28712February 7, 2011 at 3:52 am #28713amin007ParticipantThis post should explain this in details:
http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/
February 7, 2011 at 4:11 am #28714ericgallagherMemberI am sorry, but I tried following those directions and I still have nothing. The 2nd link you gave does not tell me where to put the final bit of code. Also, the theme has several javascript files that it calls on so was not sure what to put for the 2nd set of code.
I love your plugins and want to use them and I understand this is frustrating for both of us. I am not a developer and need more specific instructions.
Thank you for your help so far!
February 8, 2011 at 12:16 am #28715ericgallagherMemberFYI. I have disabled the plugin until I get things figured out.
February 8, 2011 at 4:36 am #28716amin007ParticipantAt this stage, you only need to worry about including the JQuery library to the theme using the proper way. The other javascript libraries can stay how they are.
February 8, 2011 at 2:56 pm #28717ericgallagherMemberOk, so I have included the <?php wp_enqueue_script(“jquery”); ?> before the wp_head in the header.php.
I tried adding the code below to the NEW 1.5 version at the top of the document and it did nothing. Am I missing something or doing something wrong?
var $j = jQuery.noConflict();
$j(function(){
$j(“#sidebar li a”).hover(function(){
$j(this).stop().animate({
paddingLeft: “20px&”
}, 400);
}, function() {
$j(this).stop().animate({
paddingLeft: 0
}, 400);
});
});
February 9, 2011 at 4:18 am #28718amin007ParticipantYou have now added JQuery to your theme in the proper way and it won’t cause any conflict with other plugins trying to use the JQuery library too. If a certain JQuery code is not working with this method of inclusion then your theme developer need to debug it for you as I don’t know that particular code.
FYI – WordPress includes JQuery 1.4.2 as of now (it always includes the latest stable build of JQuery not the latest latest that is on the JQuery site).
-
AuthorPosts
- You must be logged in to reply to this topic.