Why does my below code not work in Safari and firefox?
Why does my below code not work in Safari and firefox?
Why does my below code not work in Safari and firefox?
The below code does not call my page method. but it works on IE. Is there any thing need to enable Ajax mehod call. function SendMsg() { var user = document.getElementById('<%=User.ClientID %>'); var val = user.value; var nonrno = 1234; var rno = 123;
var options = { type: "POST", url: "Test.aspx/SendMessage", data: "{'toMailAddress':'" + val + "','rno':'" + rno+ "', 'nonrno':'" + nonrno+ "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var val1 = response.d; alert(val1); if (val1 == "1") { // Below code is used to close the window, if message has been sent to the user sucessfully. var windowObj = window.self; windowObj.opener = window.self; windowObj.close(); } }, error: function (result) { alert("Error in " + result); } }; //Call the PageMethods $.ajax(options); }