Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13418 closed bug (duplicate)

jQuery selector $() throws 'unrecognized expression', when creating a DOM element with spaces in front

Reported by: oligsei.reznikov@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:

Description

Example:
jQuery 1.9.x

> $('<span />');
  [<span></span>]
> $(' <span />');
  Error: Syntax error, unrecognized expression: <span />

jQuery 1.8.x

> $('<span />');
  [<span></span>]
> $(' <span />');
  [<span></span>]

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #13223.
http://jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring

Use the jQuery Migrate plugin if you need it.

Note: See TracTickets for help on using tickets.