Skip to main content

Bug Tracker

Side navigation

#7526 closed bug (worksforme)

Opened November 15, 2010 11:18PM UTC

Closed November 16, 2010 09:40AM UTC

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

Reported by: sankpand@cisco.com, vattri@cisco.com Owned by: sankpand@cisco.com, vattri@cisco.com
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).

Attachments (0)
Change History (3)

Changed November 16, 2010 12:44AM UTC by jitter comment:1

_comment0: → 1289868436227204
owner: → sankpand@cisco.com, vattri@cisco.com
status: newpending

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

Changed November 16, 2010 03:30AM UTC by jitter comment:2

_comment0: Replying to [comment:1 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. \ > \ > ---- \ > 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 \ > [http://docs.jquery.com/How_to_Report_Bugs How to report bugs] \ 1289899989475454

Replying to [comment:1 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

Changed November 16, 2010 09:40AM UTC by jitter comment:3

_comment0: → 1289900958693858
_comment1: 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()` ([http://api.jquery.com/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.1289901101645406
resolution: → worksforme
status: pendingclosed

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/

If there is no misunderstanding on html() and you still think there is a bug please report back and provide more information on your platform and exact FF version or anything other we might need to reproduce the bug.

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.