Ajax POSt无法在IE11中运行
发布时间:2020-12-16 02:46:48 所属栏目:百科 来源:网络整理
导读:我的网页上有一个按钮,它在下面调用ajax方法 $.ajax({ cache: false,type:'POST',data: 'type='+userType +'user='+user,url:' ".yiihelpersUrl::to([$program.'/'.$url.'/setcustomer/'])." ',success: function(data) { console.log('Hii'); $('#phoneE
我的网页上有一个按钮,它在下面调用ajax方法
$.ajax({ cache: false,type:'POST',data: 'type='+userType +'&user='+user,url:' ".yiihelpersUrl::to([$program.'/'.$url.'/setcustomer/'])." ',success: function(data) { console.log('Hii'); $('#phoneErr').html(data); } }); 这适用于IE11以外的所有浏览器 SCRIPT7002: XMLHttpRequest: Network Error 0x800c0008,The download of the specified resource has failed. 有没有人遇到过这个问题,解决方法是什么? 我的PHP代码在setcustomer操作中有一个重定向.这个问题可以与它有关吗? 我的ajax响应机构说Key Value 解决方法
我做了下一个解决方案:
在js中: $(document).ajaxComplete(function (event,xhr,settings) { var url = xhr && xhr.getResponseHeader('X-Redirect'); if (url) { window.location = url; } }); 在php(yii2)中(即不通过ajax理解302,我们发送200): $this->redirect(['index','id' => $model->id],200); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |