Side navigation
#7593 closed bug (worksforme)
Opened November 22, 2010 01:53PM UTC
Closed November 22, 2010 02:37PM UTC
Bug in html() in jQuery 1.4.x (ok in jQuery 1.3,2)
Reported by: | Ondrej.Fuxa@ys.cz | Owned by: | Ondrej.Fuxa@ys.cz |
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | ajax | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello, I have application based on jQuery 1.3.2 and I want to load new jQuery but I find problem in new release. I load part of HTML that contains FORM element by AJAX. But in new release of jQuery the part of HTML is truncated. Example of my code:
var html = $.ajax({
url: DB_NAME_PRODUKTY + "/menu.html?OpenPage",
async: false
}).responseText;
NOW IT IS OK
$("#pcModalDialog2").html(html);
NOW THE VAR HTML IS TRUNCATED
AFTER I put HTML to DIV the HTML element FORM is truncated. $.ajax return this:
<div class="roundedcornr_top"><div></div></div>
<div class="roundedcornr_content">
<form name="menu">
<input name="username" value="" type="hidden">
<table>
<tr><td id="pcExtendedTableTitle">Nastavení produktového navigačního menu</td></tr>
<tr><td><input checked type="radio" name="menu" value="standard" /> Standardní menu<br/><input type="radio" name="menu" value="filesystem" /> Stromové menu</td></tr>
<tr>
<td align="center">
<input type="button" value="Potvrdit" onClick="setMenuTyp()">
<input type="button" value="Zavřít" onClick="modalBgImgPK(false,'pcModalDialog2');">
</td>
</tr>
</table>
</form>
</div>
<div class="roundedcornr_bottom"><div></div></div>
but after I insert this HTML to DIV I have only this:
<div class="roundedcornr_top"><div></div></div>
<div class="roundedcornr_content">
<input name="username" value="" type="hidden">
<table>
<tbody><tr><td id="pcExtendedTableTitle">Nastavení produktového navigačního menu</td></tr>
<tr><td><input checked="checked" name="menu" value="standard" type="radio"> Standardní menu<br><input name="menu" value="filesystem" type="radio"> Stromové menu</td></tr>
<tr>
<td align="center">
<input value="Potvrdit" onclick="setMenuTyp()" type="button">
<input value="Zavřít" onclick="modalBgImgPK(false,'pcModalDialog2');" type="button">
</td>
</tr>
</tbody></table>
</div>
<div class="roundedcornr_bottom"><div></div></div>
In jQuery 1.3.2 is everything OK.
Attachments (0)
Change History (2)
Changed November 22, 2010 02:14PM UTC by comment:1
component: | unfiled → ajax |
---|---|
owner: | → Ondrej.Fuxa@ys.cz |
status: | new → pending |
Changed November 22, 2010 02:37PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | pending → closed |
test case reproduced from the ~~horrible~~ html blob you pasted into the ticket. Works for me.
The html you provided is invalid and that's most likely the cause for the problems you are experiencing. Also you should consider not doing async: false
and $.ajax({...}).responseText
but instead use the success
callback for this.
If you feel this ticket was incorrectly closed or the bug still persists for you with the newest jQuery version, feel free to report back with a reduced and reproducible test on http://jsfiddle.net and request to reopen the issue.
Please provide a reduced test case at http://jsfiddle.net - Thanks!