The article above says HTTP options. It's been a long time. I tried many versions of jquery, and the following code was not a problem to test on a colleague's machine. The normal request, one on my machine will appear on the option, Online said first to the server pre-check and so on. Why is it normal to work on a colleague's machine? Finally find out why. is i in the HTML page also introduced a global JS file, which has a global configuration crossdomain:false, so I in the AJAX request is added Crossdomain:true, OK. Make its request a cross-domain request.
Postdata:function (t,i) {
var i=i| | 0;
var ad_type = 1;
var ad_pos = ';
var click_close = $ (". Pop_body"). attr ("Click_close"); Click on to close
if (t = = ' show ') Ad_type = 1;
if (t = = ' close ') Ad_type = 3;
if (t = = ' clicks ') {
Ad_type = 2;
Ad_pos = this.winoptions.type[' clicks '][i];
if (click_close) $.ydapp.client.hidepopwindow ();
}
if (Ad_type = = 3) {
$.ydapp.client.hidepopwindow ();
}
var closetips = function () {
if (Ad_type = = 3) $.ydapp.client.closepopwindow ();
if (Ad_type = = 2 && click_close) $.ydapp.client.closepopwindow ();
}
var post_data = {' Preview ': This.winOptions.is_preview,
' oem_id ': this.winOptions.oem_id,
' client_id ': this.winOptions.client_id,
' Client_ver ': This.winOptions.client_ver,
' tips_id ': this.winOptions.tips_id,
' Tips_name ': This.winOptions.tips_name,
' Ad_type ': Ad_type,
' Ad_pos ': Ad_pos
};
$.ajax ({
Type: ' POST ',
URL: $.ydapp.config.site_url+ "/ntips/ajaxcount",
Data:post_data,
DataType: ' Jsonp ',
Crossdomain:true,
JSONP: ' Jsoncallback ',
Success:closetips,
Error:closetips
});
},
Also, be aware that JSONP cross-domain requests are get methods and cannot upload files.
When cross-domain, the JS Ajax request appears in the options request