Skip to main content

Bug Tracker

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)
  • ok.txt (3.8 KB) - added by chsenr March 06, 2008 06:21PM UTC.
  • oops.txt (3.8 KB) - added by chsenr March 06, 2008 06:21PM UTC.
Change History (4)

Changed March 06, 2008 06:30PM UTC by chsenr comment:1

my ie verson is ie6

Changed March 17, 2008 10:44PM UTC by flesler 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 davidserduke comment:3

component: coreajax
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: criticalmajor

Changed January 20, 2009 04:08AM UTC by brandon comment:4

resolution: → worksforme
status: newclosed

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.