SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object doesn't support this property or method for jquery.min.js

    I'm developing a website and am testing in IE 8 and am getting an error "Object doesn't support this property or method" for https://ajax.googleapis.com/ajax/lib.../jquery.min.js when I click on the error message on the lower-left of the browser window.

    This error comes on only when I am at the home page, then if I click on Lawn Care on the right. It is supposed to highlight the word and scroll to it. It is fine if I'm already on the Maintenance page.

    The site works in all browsers except IE 8. Please go to http://serenitylandscapes.net to view it.

    When I look up the error message on google, people suggested to reset IE, but that doesn't seem to solve the issue.

    Thanks!

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WebKite console says that a certain object has no method replace(). It seems it might be the following line:
    Code JavaScript:
    var myLocation = document.location.hash.replace("#","");

    Sorry for not providing some additional input, I'm way too tired and about to pass out but this should put you on track

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,718
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    No it's not that line, because you've commented out that code.

    The error comes from jQuery itself, on line 100 of the minified code. The replace part of that code is:
    Code:
    k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");
    Using the unminified version of jQuery's code, the above translates to:

    Code javascript:
    Sizzle = function( query, context, extra, seed ) {
    	context = context || document;
     
    	// Make sure that attribute selectors are quoted
    	query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");

    So, it's a selector of some kind, that's causing the problem.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,718
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Setting a breakpoint at line 17 of the php page
    Code:
    $('#col1s').jScrollPane();
    gets in before the error occurs.

    Line 18 is too late, the error occurs before we get there. So, it's jScrollPane somehow causing the problem.

    Further stepping through the code causes us to see that the error occurs at this code here:
    Code:
    if (e.length && pane.find(e)) {
    Where e is a jQuery object that contains the linked-to element, and the error occurs during the pane.find(e) part of the code.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •