Bug Tracker

Modify

Ticket #2468 (closed bug: worksforme)

Opened 5 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

Description (last modified by davidserduke) (diff)

$.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

ok.txt Download (3.8 KB) - added by chsenr 5 years ago.
oops.txt Download (3.8 KB) - added by chsenr 5 years ago.

Change History

Changed 5 years ago by chsenr

Changed 5 years ago by chsenr

comment:1 Changed 5 years ago by chsenr

my ie verson is ie6

comment:2 Changed 5 years ago by flesler

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.

comment:3 Changed 5 years ago by davidserduke

  • Priority changed from critical to major
  • Component changed from core to ajax
  • Description modified (diff)

comment:4 Changed 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to worksforme

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.