jQuery - Object Expected on IE and $(document).ready(function() {});

16,685

Solution 1

Here's one problem that can cause IE to choke where other browsers may not:

$('#' + resultDivName).animate({
  height: '300px', // <=== TRAILING COMMA
}, 500, function() {
  // Animation complete.
});  

Then, in your qtip call, you have:

target: 'popPart_WM300BP'

I believe target takes a jQuery DOM object, not a string. DebugBar points to this line as the cause of "object expected".

Finally, it looks like this version of jQuery Tools includes jQuery 1.4.2. Perhaps 1.4.3 or 1.4.4 would be worth a try.

Solution 2

If you are testing over a HTTPS connection, check if you are choosing view only the content that was delivered securely. If you choose YES maybe the scripts will not be loaded.

Solution 3

Could be the url you're using for jquery.tools. It is missing the http: part.

//cdn.jquerytools.org/1.2.5/jquery.tools.min.js

should be

http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js

Share:
16,685
Dutchie432
Author by

Dutchie432

There is a lot I could write here. Generally speaking, I am a (90% self-taught) computer programmer specializing in business related software utilizing .NET, PHP, JS, AJAX, jQuery, and XCode.

Updated on June 22, 2022

Comments

  • Dutchie432
    Dutchie432 almost 2 years

    I have a page ([LINK REMOVED]) that works completely well in FireFox and Chrome, but for some reason I am getting an "Object Expected" error in most, if not all versions of IE.

    The error occurs on the line

    $(document).ready(function() {
        //^ Error occurs here ^
        ...
    }
    

    I am using jQuery Tools, which implements jQuery 1.4.2, as well as some additional stuff.

    I've done some reading around. I've tried to put the ready function at the end of the code, right before the </body> tag - in addition, I've tried implementing a timer to let IE load before executing, and I can not shake this error.

    • Liam Galvin
      Liam Galvin over 13 years
      Could you paste the source of the whole page?
    • Dutchie432
      Dutchie432 over 13 years
      Thanks for the reply. It's quite a bit of code so I provided a link...
    • Ben Lesh
      Ben Lesh over 13 years
      Did you try the $(function() { }) means of document ready?
    • Dutchie432
      Dutchie432 over 13 years
      @blesh - yes.. I even still have it up at index2.php
    • lonesomeday
      lonesomeday over 13 years
      What is the exact error message?
    • Dutchie432
      Dutchie432 over 13 years
      "Object Expected" line 768 char 7 code 0
  • user113716
    user113716 over 13 years
    @Ken - Only if that's the correct path. Looks to me more like OP is attempting to link to the jquerytools cdn.
  • Dutchie432
    Dutchie432 over 13 years
    I actually have the JS file hosted locally on my web server... what you saw with the long path was an experimentation. I thought maybe the jQuery part was 'getting lost' so I wanted to point to the actual JS file - I apologize and will stop playing around with it. Up-Vote for the catch, though.
  • Dutchie432
    Dutchie432 over 13 years
    Wow. I feel like a complete tool. It was the extra commas (it was actually in more than one spot). Thank you very much.
  • Dutchie432
    Dutchie432 over 13 years
    also, I will look into the target/DOM issue as well. Thanks very much.
  • Dutchie432
    Dutchie432 over 13 years
    initializePageMain() is in index.js, and doToolTips() is at the bottom of index.php - just before the $(document).ready()
  • Matstar
    Matstar almost 13 years
    Missing http: is fine in itself - paulirish.com/2010/the-protocol-relative-url
  • user113716
    user113716 almost 13 years
    @Henrik N: Interesting. Thanks for the link.