Bug Tracker

Modify

Ticket #6604 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

Dup of #6236.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.