Side navigation
#5561 closed bug (invalid)
Opened November 28, 2009 07:35AM UTC
Closed November 28, 2009 06:02PM UTC
ajax bug in document.getElementById and $("#ID")
Reported by: | newpat | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | ajax | Version: | 1.3.2 |
Keywords: | $() | Cc: | |
Blocked by: | Blocking: |
Description
var html = $.ajax({
url: serverPage,
async: false
}).responseText;
if (html){
document.getElementById(objID).innerHTML=html;
$("#dialog").dialog('open');
}else{
alert("Error!");
}
The above code can be runned perfectly (objID = "div1"), but the following code cannot update the "objID" div(objID = "#div1")
var html = $.ajax({
url: serverPage,
async: false
}).responseText;
if (html){
$(objID).innerHTML=html;
$("#dialog").dialog('open');
}else{
alert("Error!");
}
Attachments (0)
Change History (1)
Changed November 28, 2009 06:02PM UTC by comment:1
resolution: | → invalid |
---|---|
status: | new → closed |
Your code is invalid. There is no innerHTML property on jQuery objects. Use $(objID).html(html).