Bug Tracker

Opened 5 years ago

Closed 5 years ago

#7526 closed bug (worksforme)

there is bug in the html() method of the latest jquery.

Reported by: sankpand@… Owned by: sankpand@…
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

in the jquery 1.4.2, and 1.4.3, inside html(value){} method there is this[i].innerHTML = value that replace the innerHTML of this object with value, and this is causing issue in case when we have table element inside the div element (like <div><table></table></div>). what it does is finally it separates the div and table elements as (<div></div> <table></table> this needs to be changed to this[i].html(value).

Change History (3)

comment:1 follow-up: Changed 5 years ago by jitter

  • Owner set to sankpand@…
  • Status changed from new to pending

Please submit a reduced test case which reproduces the issue you are experiencing (ideally on http://jsFiddle.net). So that we can investigate this issue further.


How to report bugs

Last edited 5 years ago by jitter (previous) (diff)

comment:2 in reply to: ↑ 1 Changed 5 years ago by anonymous

Replying to jitter:

Please submit a reduced test case which reproduces the issue you are experiencing (ideally on http://jsFiddle.net). So that we can investigate this issue further.


How to report bugs

please use the example http://jsfiddle.net/xGKsT/ , but this is reproducible only on mozilla 3.6. Please use same kind of example as given on link, the result will be that div and table will get separated

Last edited 5 years ago by jitter (previous) (diff)

comment:3 Changed 5 years ago by jitter

  • Resolution set to worksforme
  • Status changed from pending to closed

Thanks for providing a test case. I tried your test case in FF 3.6.12 on Windows XP with jQuery 1.4.2/1.4.3/1.4.4 but I couldn't reproduce the bug you described.

Maybe there is a misunderstanding on the working of html() (api docs)

Get the HTML contents of the first element in the set of matched elements.

Check my updated test case which shows that after using html() the html of .replace and .result are identical

http://jsfiddle.net/xGKsT/1/

P.S.: The next time please don't post as anonymous but instead with the same credentials as when you opened the ticket, else the ticket status doesn't change and we might miss your contribution.

Version 1, edited 5 years ago by jitter (previous) (next) (diff)
Note: See TracTickets for help on using tickets.