error: object doesn't support this property or method

Discussion in 'JavaScript' started by 123GoToAndPlay, Oct 21, 2009.

  1. #1
    This drives me ....

    IE 7 gives an error

    
    line: 103
    error: object doesn't support this property or method
    code: 0
    
    Code (markup):
    but line 103 is empty,

    How can i find the object and error???

    ps: When i use firebug/firefox i don't get an error on line 103
     
    123GoToAndPlay, Oct 21, 2009 IP
  2. ThomasTwen

    ThomasTwen Peon

    Messages:
    113
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    check the line before it (line 102). Have you ended it properly? Forgot any quotes?


    Also, you have a question about JavaScript. This is the PHP forum.
     
    ThomasTwen, Oct 21, 2009 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Are you looking at the sourcecode or the HTML. check line 103 in whatever file is asked for
     
    JAY6390, Oct 21, 2009 IP
  4. 123GoToAndPlay

    123GoToAndPlay Peon

    Messages:
    669
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Tx guys, for the info so far
    Wow totally overlooked i was posting in PHP (it's a habit, ;))

    I will check for quotes as it's a mistake i made in the past.

    I looked in the HTML code as the browser reads line 103 in HTML, right??/
     
    123GoToAndPlay, Oct 21, 2009 IP
  5. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No. You check the filename that it says the error is in in the sourcecode, since PHP is server side, it gets executed before it gets sent to your browser
     
    JAY6390, Oct 22, 2009 IP
  6. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #6
    erm - do you per chance do something like this:

    
    $(blah).css({
        border: "1px solid #000",
        backround: "red", // <-------------- notice trailing ,
    });
    
    or...
    
    var foo = {
        init: function() {
            alert("hi"); 
            return this;
        },
        close: function() {
            alert("bye");
        },  // <-------------- notice trailing ,
    };
    
    foo.init().close(); // alerts hi and then bye in all browsers but IE.
    
    Code (markup):
    these are two examples that will fail in IE with the above error but will work in other browsers. any json structure must be terminated. consider this in php:

    
    $array = Array(
       "id" => 25, 
       "id" => 29,
    ); // works fine despite of , after 29
    Code (markup):
    IE is the only thing i know of that treats the intention of adding more members to an array or object as a syntax error. crap isn't it!
     
    dimitar christoff, Oct 22, 2009 IP