Ajax requests for ordinary jquery are visible in the console, as follows:
When using JSONP (JSON with padding) for Ajax cross-domain, it is found that Ajax requests are not displayed in the console.
The cross-domain code is as follows:
Front-End Code:
$.ajax ({type:"Get",//Jquey does not support post mode cross-domainAsync:false, URL:"Http://www.cnblog.com",//URL for cross-domain requestDataType:"Jsonp", //passed to the backend to get the parameter name of the JSONP callback function name (default: callback) to cobble together the return valueJsonp:"Callback", //Custom JSONP callback function name, default to jquery auto-generated random function nameCallback:"Testcallback", //This callback function is executed dynamically after a successful acquisition of the JSON data on a cross-domain serverSuccess:function(JSON) {console.log (JSON); } });
Background:
$callback $_get // value is Testcallback Echo $callback . "({"key":" Value "})";
Instead of a simple JSON string, you can see that the background returned is actually testcallback (JSON string).
In addition, jquery also has a function Jquery.getjson (url,data,success (DATA,STATUS,XHR)) that can also complete cross-domain requests.
Now look at the Firebug console Ajax will not show. If you want to hide in the JS file, consider encrypting JS.
Use cross-domain requests to hide Ajax requests in the Firbug console