Skip to main content

Bug Tracker

Side navigation

#6604 closed bug (duplicate)

Opened May 27, 2010 08:51AM UTC

Closed May 28, 2010 12:15AM UTC

html() usage can destroy forms in Internet Explorer 8.

Reported by: jonathan.slenders Owned by:
Priority: Milestone: 1.4.3
Component: core Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:
Description

Maybe this is rather an IE8 bug than JQuery bug, I'm not sure.

Internet explorer often strips the quotes around html attributes, and therefore, the html variable in the code below will contain somewhere: "<form action=/action/a/>"

The forward-slash/greater-than combination will also act as the end of the form.


var html = $('<div><p><form action="/action/a/" method="get"><input type="submit" value="aaa" /></form></p></div>').html();

alert ($(html).html());


This will display:

<FORM method=get action=/action/a></FORM><INPUT value=aaa type=submit></FORM>


This behaviour in IE8, will make the following code inreliable, as it can destroy the forms.

$(this).html($(this).html());

Tested in Jquery 1.4.1

Attachments (0)
Change History (1)

Changed May 28, 2010 12:15AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Dup of #6236.