javascript unexpected identifier

javascript unexpected identifier

Yes, you have a } too many. Anyway, compressing yourself tends to result in errors.

function () {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        document.getElementById(content).innerHTML = xmlhttp.responseText;
} // <-- end function?, data/ + id + .html, true);

Use Closure Compiler instead.

I recommend using – if you paste your code snippet into it and press beautify, the error is immediately visible.

javascript unexpected identifier

In such cases, you are better off re-adding the whitespace which makes the syntax error immediate apparent:


Theres a } too many. Also, after the closing } of the function, you should add a ; before the

And finally, I dont see what that anonymous function does up there. Its never executed or referenced. Are you sure you pasted the correct code?

Leave a Reply

Your email address will not be published.