I know jQuery / ajax in IE is a common problem. There are many great stack overflow tips here, but none of this helped me. The following code works fine in firefox, but not in IE:
$.ajaxSetup({ cache: false })
$.ajax({
url: 'FunDataService.asmx/' + funDataMethod,
type: 'POST', dataType: 'html', cache: false, timeout: 3000,
error: function() {alert('Error updating fun information. Refresh the page and try again.');},
success: function(htmlFunInfo) {
alert($(htmlFunInfo).text());
$("#fundiv").html($(htmlFunInfo).text())},
data: parameters
});
You can see my caching attempts ; I also added random values to the URL. I also tried adding various content headers to the web service:
' Context.Response.ContentType = "text/html; charset=utf-8"
' Context.Response.ContentType = "text/html"
Context.Response.ContentType = "text/plain"
The alert command is for debugging, of course. In FF $(htmlFunInfo).text(), div tags sent from the server I want to insert. In IE, this is an empty string.
Does anyone know how to access this string value in IE? Thank!
Edit The
response from the server is as follows:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="tempuri.org/">
<div>stuff</div>
<div>more stuff</div>
</string>
, , div.
2 ! :
Return RemarkHtml
Context.Response.Write(RemarkHtml)
, divs, . , , , IE .text().
, !