1

Hey guys out of no where I got this issue that came up on a wordpress site, no idea why. So let me tell you the issues:

Uncaught TypeError: Cannot read property 'msie' of undefined jquery.rating.pack.js:17 from jquery.rating.pack.js:17

Uncaught TypeError: Object [object Object] has no method 'live' from jquery.colorbox-min.js:4

So I have 2 plugins that stopped working because of this. I don't know if there was an update of some sort or where to even begin.

If you could give me a hand I would appreciate it.

Let me know if you need anything!

EDIT:

prodjsoundlighting.com - link to site with issue.

2 Answers 2

2

You have two jQuery scripts included on your website, you need to remove the one that is not from wordpress.

/wp-includes/js/jquery/jquery.js?ver=1.8.3

http://code.jquery.com/jquery-latest.min.js

What happens is all jQuery extensions (colorbox, rating pack) attach themselves on jquery object from first jquery script, then the second jquery script overwrites jquery object and you can't access any of the previously attached jquery extensions.

EDIT: To avoid "$ is not a function" errors you will need to either replace all $ to jQuery

$(document).ready(function(){

will become

jQuery(document).ready(function(){

OR whats usually used, encapsulate your code with anonymous function like this:

(function($) {
    // here goes your javascript code where you access jquery object will dollar sign
})(jQuery);

P.S. There is one quick fix you could use until you fix your code. Just use this in the same place where you had that other jquery call:

<script>var $ = jQuery;</script>
Sign up to request clarification or add additional context in comments.

4 Comments

If I do that then Jquery becomes undefined"?
So how would I stop this because removing it did not work, it just tells me jquery is undefined.
Dollar sign ($) becomes undefined or jQuery becomes undefined? Can you update your question with link to your website, I don't have the link anymore :)
So if I take out the <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> I get this Uncaught TypeError: Property '$' of object [object Window] is not a function multiple times...I'll leave it without that so you can see what I am talking about. Also if I put it back than I get the error above.
2

You should update to the latest version of Colorbox. Grab it here.

Old versions of Colorbox relied on .live(), which is a deprecated function (from 1.7+) and removed completely from jQuery 1.9+.

1 Comment

this newer version js file working good..i fix my .live() problem using this newer version colorbox js..Thnks SiamKreative

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.