Side navigation
#2468 closed bug (worksforme)
Opened March 06, 2008 06:20PM UTC
Closed January 20, 2009 04:08AM UTC
html() funtion of jQuery does't work correctly in ie
| Reported by: | chsenr | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.4 |
| Component: | ajax | Version: | 1.2.3 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
$.ajax({
type: "GET",
url: '/test/ok.txt',//the html text in this file can't be appended to <div id="c"></div> correctly in ie
//url: '/test/oops.txt',//but this is not.
//by the way .the content in two file can be appended to <div id="c"></div>.
complete :function (http_req,status){
if(status=='success'){
jQuery('#c').html(http_req.responseText);
} else { //error
}
}
});
encoding of ok.txt and oops.txt is utf8.
Attachments (2)
Change History (4)
Changed March 06, 2008 06:30PM UTC by comment:1
Changed March 17, 2008 10:44PM UTC by comment:2
Have you tried using the options 'success' and 'error' instead ?
The 'complete' seems to have a different purpose, it doesn't even receive the response.
Changed March 27, 2008 06:35AM UTC by comment:3
| component: | core → ajax |
|---|---|
| description: | $.ajax({ \ type: "GET", \ url: '/test/ok.txt',//the html text in this file can't be appended to <div id="c"></div> correctly in ie \ //url: '/test/oops.txt',//but this is not. \ //by the way .the content in two file can be appended to <div id="c"></div>. \ complete :function (http_req,status){ \ if(status=='success'){ \ jQuery('#c').html(http_req.responseText); \ } else { //error \ } \ } \ }); \ \ '''encoding of ok.txt and oops.txt is utf8.''' → {{{ \ $.ajax({ \ type: "GET", \ url: '/test/ok.txt',//the html text in this file can't be appended to <div id="c"></div> correctly in ie \ //url: '/test/oops.txt',//but this is not. \ //by the way .the content in two file can be appended to <div id="c"></div>. \ complete :function (http_req,status){ \ if(status=='success'){ \ jQuery('#c').html(http_req.responseText); \ } else { //error \ } \ } \ }); \ }}} \ \ '''encoding of ok.txt and oops.txt is utf8.''' |
| priority: | critical → major |
Changed January 20, 2009 04:08AM UTC by comment:4
| resolution: | → worksforme |
|---|---|
| status: | new → closed |
This is because the oops.txt has a BOM (Byte Order Mark) and IE can't seem to handle it. Remove the BOM and it will work just fine.
my ie verson is ie6