I want cross domain data access for my project and i made it work but i am stuck with this pop up which says 'This page is accessing information.......' .I don't want to suppress it by explicitly changing browser settings, can't i modify my working code to suppress this message.
My working code with pop up
$.ajax({
url: "http://sys85/testservice/serviceCall.ashx",
dataType: "text",
type: 'get',
crossDomain: true,
success: function (data) {
},
error: function (jqXHR, textStatus, errorThrown) {
if (window.console) console.log("Error... " + textStatus + " " + errorThrown);
}
});
}
My handler file to return result(serviceCall.ashx)
string result = "121";
context.Response.ContentType = "application/json";
context.Response.Write(result);
do i have to make any changes with my handler file ??
Also tried this way
$(document).ready(function () {
var url = "http://sys85/testservice/serviceCall.ashx";
$.getJSON(url + "?callback=?", null, function (data) {
alert(data);
})
.error(function (jqXHR, textStatus, errorThrown) {
console.log("Error... " + textStatus + " " + errorThrown);
document.getElementById('lblmsg').value = "Error... " + textStatus + " " + errorThrown;
})
});
i get "Uncaught TypeError: Object # has no method 'error' " error
Tried every possible ways to get rid of this message Any help will be appreciated.