Ticket #13976 (closed bug: fixed)
Invalid HTML passed into .html() throws 'tmp is null' error
|Reported by:||patrick.guinness@…||Owned by:|
An error is thrown in jQuery 2.0.2, whereas jQuery 1.9.1 appears to strip out the offending tags.
2.0.2 example: http://jsfiddle.net/pguinness/ndQ6R/2/
1.9.1 example: http://jsfiddle.net/pguinness/axDzX/2/
Looks like the issue is occurring in the buildFragment() method. jQuery 1.9.1 runs the HTML content through the createSafeFragment() method (line 6564), whereas 2.0.2 uses the native .createDocumentFragment() (line 5779) without doing any additional parsing.
Tested on Mac OS 10.8.3 in the following browsers:
Chrome 27.0.1453.93 Firefox 21.0 Safari 6.0.4
- Priority changed from undecided to low
- Component changed from unfiled to manipulation
- Milestone changed from None to 2.next
- Status changed from open to closed
- Resolution set to fixed