Bug Tracker

Opened 5 years ago

Closed 5 years ago

#15199 closed bug (wontfix)

Bug in Chrome, no show Syntax error

Reported by: cuadove Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

This code works in Chrome Correctly (My version: 36.0.1985.125 m) instead of: "Error: Syntax error, unrecognized expression: input[name=test_name"

<!DOCTYPE html>
<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    </head>

    <body>
        <form>
            <input type="text" name="test_name" value="hi!" />
        </form>

        <script>
            var ready = $("input[name=test_name]");
            console.log(ready.val());
            var error = $("input[name=test_name");
            console.log(error.val());
        </script> 
    </body>
 </html>

Change History (1)

comment:1 Changed 5 years ago by gibson042

Resolution: wontfix
Status: newclosed

Yes, that is a bug in Chrome: https://codereview.chromium.org/320783002/ (or more specifically, a problem with the CSS spec in that it allows implicit closing of strings/brackets/etc.). Sizzle and jQuery are more strict, but we always try the native engine first so these just slip under our radar.

http://jsfiddle.net/BbuNm/

Note: See TracTickets for help on using tickets.