views:

475

answers:

2

I've tried this with a couple of different plugins, so I'm sure it's not them. I also have one running on my personal machine and it works just fine.

I'm loading jquery and then loading the plugin second. Then the next line of code is calling the plugin via:

$("a[rel]").colorbox(...)

or

$("a[rel]").overlay(...)

and I'm getting "object does not support property or method". It's not on the html object, I've narrowed it to the actual function call to jquery plugin -- the $("a[rel]") selector is working fine alone. It's as if the plugin is never actually loading.

Have any of you ever seen this? I'm running on XP, so IIS6 (5?) Latest jquery 1.3.2 though I tried 1.3.1 and 1.2.6.

Much appreciated!!!

+1  A: 

Do you try to enable javascript debugging in your browser, maybe you can catch some error, and that why browser doesn't loading plugin file. You can also try to load plugin dynamically using getScript method of jquery and on complete event run your function.

$.getScript("http://dev.jquery.com/view/trunk/plugins/color/jquery.color.js", function(){
  $("#go").click(function(){
    $(".block").animate( { backgroundColor: 'pink' }, 1000)
      .animate( { backgroundColor: 'blue' }, 1000);
  });
});
Maksim Kondratyuk
+6  A: 

I had the same problem yesterday, and it was because I had this line twice:

<script src="jqueryScripts/jquery-1.3.1.js" type="text/javascript"></script>

It was in an ASP project and I included another .asp page which also had the reference, so it took me 2 hours to figure out..

Maybe you have the same problem?

Thomas Stock
Bingo... another component was loading its own jquery...
peiklk
Hehe.. I hope I saved you some time. I got pretty desperate yesterday.
Thomas Stock
Thanks for this - I also have a 3rd party component loading jQuery.
j.strugnell