Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am developing an application in that i have to get data from a web service for that i have used javascript and json the code is working in IE only and i want all browser compatibility
Posted

var options = {

type: "POST",
contentType: "application/json",
url: ImportInquiryurl,
data: JSON.parse(objinquirys),
dataType: "json",
success: function (msg) {
document.getElementById('<%= txtFirstname.ClientID %>').value = "";
document.getElementById('<%= txtLastName.ClientID %>').value = "";
document.getElementById('<%= txtCompanyName.ClientID %>').value = "";
document.getElementById('<%= txtPhoneNumber.ClientID %>').value = "";
document.getElementById('<%= txtemailaddress.ClientID %>').value = "";
document.getElementById('<%= txtTopic.ClientID %>').value = "";
document.getElementById('<%= txtNotes.ClientID %>').value = "";
document.getElementById('<%= txtZip.ClientID %>').value = "";
document.getElementById('<%= ltrMessage.ClientID %>').innerHTML = "Inquiry Created Successfully";
},
failure: function (error) {
}
};
$.ajax(options);




The code for which i want browser compatibility
 
Share this answer
 
Unfortunately IE still doesn't support native JSON. There is a very good polyfill. Called JSON2. Here is the CDN;
http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js[^]
 
Share this answer
 
Comments
Rajan Shuklan 6-Nov-12 23:50pm    
This works well with IE but doesnt work with Chrome,FF and Safari.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900