调用javascript函数时出错:SCRIPT7002:XMLHttpRequest:网络错误0x2eff,由于错误00002eff无法完成操作 [英] Error calling javascript function: SCRIPT7002: XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff

查看:516
本文介绍了调用javascript函数时出错:SCRIPT7002:XMLHttpRequest:网络错误0x2eff,由于错误00002eff无法完成操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个aspx文件,它有一个包含以下按钮标记的javascript块:

< pre lang =   xml>< button id = btndelete {%= i%} data-file =    {%= file.name%} data-delete =   2 onclick =   alert('');确认(此。 id,'{%= file.name%}')  class  =  < span class =code-string> btn btn-danger delete data-type =   {% = file.deleteType%} data-url =   {%= file.deleteUrl%} {% if (file.deleteWithCredentials){%} data-xhr-fields = ' <跨越ss =code-string> {withCredentials:true}' {%}%}> 
< i class = glyphicon glyphicon -trash> < / i >
< span>删除< / span >
< / 按钮 >



其中确认()是:

< pre lang =   xml>< script type =   text / javascript> 
function 确认(id,fileName){
alert(' 确认开始');
var deleteFile = confirm( 你是吗?确定要删除' + fileName + '?);
var btn = document .getElementById(id);
if (btn!= null &&" deleteFile)
btn。 setAttribute( data-url,btn.getAttribute( data-url)+ & delete = + deleteFile);
alert(' 确认已结束');
}
< / script>



在所有浏览器上测试按钮时,它工作得很好,但在一台PC上它不起作用使用IE10,虽然在其他使用相同浏览器的PC上运行相同的代码。我添加了alert()仅用于测试,在这个特定的PC / IE10上,onclick事件根本没有执行。我使用F12开发人员工具,我发现当我单击此按钮时会出现以下错误:

 SCRIPT7002:XMLHttpRequest:网络错误0x2eff,无法完成操作由于错误00002eff。



任何想法可能导致什么以及如何解决??? div class =h2_lin>解决方案

不确定这对您有帮助,但请尝试以下链接:



http://stackoverflow.com/questions/14527387/script7002-xmlhttprequest-network-error-0x2ef3-could-not-complete-the-operati [ ^ ]


I have an aspx file, that has a javascript block containing the following button tag:

<pre lang="xml"><button id=btndelete{%=i%} data-file="{%=file.name%}" data-delete="2" onclick="alert('');confirmation(this.id, '{%=file.name%}')" class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
    <i class="glyphicon glyphicon-trash"></i>
    <span>Delete</span>
</button>


Where confirmation() is:

<pre lang="xml"><script type="text/javascript">
        function confirmation(id, fileName) {
            alert('confirmation started');
            var deleteFile = confirm("Are you sure you want to delete '" + fileName + "' ?");
            var btn = document.getElementById(id);
            if (btn != null && deleteFile)
                btn.setAttribute("data-url", btn.getAttribute("data-url") + "&delete=" + deleteFile);
            alert('confirmation ended');
        }
</script>


While testing the button on all browsers it worked perfectly, but on a single PC it didn't work using IE10, although on other PCs using same browser same code it worked. I added the alert() just for testing, and on this particular PC/IE10, the onclick event is not executed at all. I used F12 developer tools and I found that when I click this button the following error occurs:

SCRIPT7002: XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff.


Any ideas what might be causing that and how to fix it??

解决方案

Not sure if this will help you, but try the answer on this link:

http://stackoverflow.com/questions/14527387/script7002-xmlhttprequest-network-error-0x2ef3-could-not-complete-the-operati[^]


这篇关于调用javascript函数时出错:SCRIPT7002:XMLHttpRequest:网络错误0x2eff,由于错误00002eff无法完成操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆