ASP.NET AJAX Refused to get unsafe jsonerror header

Using ASP.NET AJAX I get the following error in Firefox and Mozilla firefox when I call asmx webservice with the [ScriptService] attribute. It works in IE9 ...

Failed to get unsafe Jsonerror header

Why is the AJAX script administrator trying to add / change this header? And how to stop it?

My javascript:

 // Asynchronous ajax call to lookup this client function CallSearch() { // Ensure correct SharePoint path is used SalesRepSearchWebServices.SalesRepSearchService.set_path("http://localhost:52182/SalesRepSearchService.asmx"); // Get our txtSearch control var txtSearch = document.getElementById("ui_txtSearch"); // Call web service SalesRepSearchWebServices.SalesRepSearchService.GetResults(txtSearch.value, "All", SearchResponse, SearchError); } // Get return value from web service function SearchResponse(result) { alert (result); var lblResults = document.getElementById("lblResults"); lblResults.innerHTML = result; } // Display error from web service function SearchError(result) { //alert(result.get_message()); var lblResults = document.getElementById("lblResults"); lblResults.innerHTML = result.get_message(); } 

And a C # snippet:

 [WebMethod] public List<Person> GetResults(string input, ResultType resultType) 
+4
source share

Source: https://habr.com/ru/post/1341075/


All Articles