New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620026 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 70895
Owner: ----
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

on* handler throws unhelpful SyntaxError

Project Member Reported by michae...@chromium.org, Jun 14 2016

Issue description

The SyntaxError thrown when evaluating problematic on* handlers doesn't really make sense and is not helpful.

Consider:

    <input onclick="foo("bar")")">

Because of the improperly nested quotes, this parses as something like:

    <input onclick="foo(" bar")")"="">

which can be simplified to:

    <input onclick="foo(">

But the error thrown when clicking is:

    Uncaught SyntaxError: Unexpected token }

Since no } actually appears in the (html) source, this is misleading and causes confusion[1].

Might be related to issue 70895.


1. Example: https://stackoverflow.com/questions/37820123/uncaught-syntaxerror-unexpected-token-when-trying-pass-data-to-jquery-variabl/37820293
 
Mergedinto: 70895
Status: Duplicate (was: Untriaged)
I agree, it looks the same.

Sign in to add a comment