Skip to content

jQuery (1.11.x) syntax error on attribute selector #246

Description

@black-snow

HtmlUnit 2.44.0

$("input[id^=validToDate")

somehow throws an SyntaxError (thrown in jquery 1.11.0 minfied line 333:)

throw new Error("Syntax error, unrecognized expression: " + a)

But it only happens with HtmlUnit. No issues with current FF or Chrome. Might be due to some fallback that jQuery does for HtmlUnit / Rhino because of some missing features?

Might be due to missing quotes and somehow this just works in actual browsers.
/edit: nope, no issues with a simple example - need to investigate further

<!doctype html>
<html>
<head>
	<meta charset="utf-8">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
	<div id="a"></div>
	
	<script>
		console.log($('div[id^=a]'))
		$('div[id^=a]').html('test')
	</script>
</body>
</html>

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions