Results 1 to 5 of 5
  1.    #1  
    I'm getting a weird syntax error and have no idea why since the character it says is there, is NOT actually there!

    Code:
    Uncaught SyntaxError: Unexpected token [, scripts/helper.jsjsjs:$3$,$102$
    Line 102 is:

    return element.clientWidth;

    But I actually think the "offender" is below that, as adding comment lines after line 102, increases the line number of the error. As far as I can tell, the line is from this function:

    LayoutManager.getDocumentHeight = function()
    {
    //The largest of body/document heights and scroll height
    return Math.max( Math.max( window.document.body.scrollHeight, window.document.documentElement.scrollHeight ), Math.max( window.document.body.offsetHeight, window.document.documentElement.offsetHeight ), Math.max( window.document.body.clientHeight, window.document.documentElement.clientHeight ) );
    };

    But I don't see anything wrong! Any ideas?
  2. #2  
    Could you give some more code from before that error line (102) ? Usually parse errors are either on the indicated line themselves, or before.

    Without seeing any area's where you actually use block quotes ( [ and ] ) it's hard to say what the problem is, missing semicolon, missing closing block quote, bad escaping in a regexp, could be numerous things.
    My Palm History (in order): IIIe SE, m130, Tungsten|T, m505, Tungsten|T3, Zire 71, m505 (owned two different ones), Zire 72, Tungsten|C, T|X, Treo 650.
    After that I got a Apple iPhone 3G, Palm Pre (GSM), Google Nexus One.
  3.    #3  
    I figured it out, but it raises another issue:

    The error was actually on line 3110. Why was it off by 3000 lines?!
  4. #4  
    I don't think it was:

    "scripts/helper.jsjsjs:$3$,$102$&$quot$;

    Line 3,102 just has a comma.
    Sprint Palm Pre - WebOS 2.1 > Sprint HTC Arrive
  5. #5  
    I don't know what exactly ended up being the problem and I can't see the rest of the code so still difficult to say to be honest. But in any case, line numbers aren't always 100% correct because an interpreter can only do (read; understand) so much of your code. If I forget to close a method in an object on line 102 and my file is 2000 lines long, it could well say there's a error in line 2000 because it's only missing the bracket there.

    At least you've solved the problem, that's what matters most

    edit:
    TIWizard might have a point there yeah, some languages specify line number + character number in that line, but that would have been the other way around.
    My Palm History (in order): IIIe SE, m130, Tungsten|T, m505, Tungsten|T3, Zire 71, m505 (owned two different ones), Zire 72, Tungsten|C, T|X, Treo 650.
    After that I got a Apple iPhone 3G, Palm Pre (GSM), Google Nexus One.

Posting Permissions