最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

woocommerce offtopic - Javascript error when adding an item to the cart

matteradmin8PV0评论
Closed. This question is off-topic. It is not currently accepting answers.

Closed 6 years ago.

  • Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
  • Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Improve this question

I have been trying to figure this issue out for hours and would really appreciate the help anyone can give. Do you have any idea how I can fix the Javascript error on this page that prevent adding items to the cart? /product/wildlife-photo-print-rhinoceros-charge-by-alex-jones/

Closed. This question is off-topic. It is not currently accepting answers.

Closed 6 years ago.

  • Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
  • Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Improve this question

I have been trying to figure this issue out for hours and would really appreciate the help anyone can give. Do you have any idea how I can fix the Javascript error on this page that prevent adding items to the cart? https://www.ourwildlife.studio/product/wildlife-photo-print-rhinoceros-charge-by-alex-jones/

Share Improve this question asked Feb 12, 2019 at 8:52 Liam MLiam M 33 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

The error I believe you are talking about when adding an item says:

Uncaught TypeError: $.parseHTML is not a function

Get ready to talk version numbers!

In this case $ is referring to the jQuery library.

jQuery.parseHTML was added in jQuery version 1.8. As it so happens, your site is currently using jQuery 1.7.2.

Since jQuery version numbers come up a lot with WordPress dev (imho), it's worth knowing how to check it. In your browser console, just type jQuery.fn.jquery and see what the answer is.

Caveat: sometimes people end up with multiple copies of jQuery on their site. You can try both jQuery.fn.jquery and $.fn.jquery and see if they're the same version. Even then you can't be sure you don't have multiple jQuery's.

So anyways, the issue is you have an old version of jQuery. That version of jQuery hasn't shipped with WordPress since WordPress 3.4. So either you have an old version of WordPress on the site and should upgrade it, or you (or a plugin you are using) are switching out the jQuery library in use on your site.

TL;DR update jQuery on your site, probably by updating WordPress.

Post a comment

comment list (0)

  1. No comments so far