jquery 跨域请求,报错:no transport

js代码如下:

 $.ajax({
            type: "POST",
            url: actionUrl,
            dataType: "json",
            data:{command: 'QUERY'},
            success: function (data) {
                console.log(data);
              
            },
            error:function(xmlHttpRequest,b ,c){
               alert(c);//提示 no transport
            }
        });

解决办法是在调用之前增加:jQuery.support.cors = true;

猜你喜欢

转载自java12345678.iteye.com/blog/2180177