I m using jquery to make an AJAX POST call to a web service, and getting a JSON object back, which gives me back some html code that i want to append to a div, it works fine in firefox but the problem is that safari doesn t do the appending, here is the example:
$.ajax({
type: "POST",
url: "ConnMgr.asmx/Request",
data: JSON.stringify(objectToSend),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response){
$( #myDiv ).empty();
$("#myDiv").append(response.d.htmlSnippet); //this doesn t work on safari but it does on FF
//$("#myDiv").append("<img src="image.png"/>")//this works in all browsers
//alert(response.d);//this works in all browsers
}
});
It seems that in safari, jquery doesn t like the idea of using a json object as an argument for append() I ve tried creating a copy of the variable before, inserting a delay, converting the variable to string before passing it, but the results are the same.
Many thanks