win10 ajax post 400,windows 10 - SCRIPT70: Permission denied on JQuery Ajax Post - Stack Overflow

开发者分享遇到的诡异问题:通过jQuery AJAX向网站POST请求刷新div内容时,在个人Windows 8和虚拟机Windows 10上正常,但在同事使用Edge浏览器时出现客户端错误SCRIPT70:Permission denied。探讨可能的解决方案,包括代码检查和安全设置对比。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I've encountered this weird error lately. Here's the flow of the entire process.

There is a JQuery ajax post call to a website that will refresh the contents of a div. It will pass in the parameters to that website and will return the HTML script.

If the post is successful, it will first clear the div and rewrite it using the return value that was retrieved from that website.

The error occurred on point 2.

Here's the weird thing:

In my machine it is working fine (Windows 8) and also in the virtual machine (Windows 10). I used the same browser (IE 11 and Edge) for both. However, my colleague was not able to do point 2 because he got the client side error SCRIPT70: Permission denied. He was using Edge.

I will post part of the code in my next update. But so far I've checked it in terms of security but none really.

How do I resolve this?

UPDATE

Here's the code that calls one website (or aspx) via JQuery Ajax Post, and retrieves and updates the div.

function RefreshDiv(isChild) {

var data = {

ActionType: "AJAX",

Action: "Refresh"

};

$.post("RefreshDivContents.aspx", data, function (result) {

if(result != '') {

var divItems;

if(isChild) {

divItems = window.parent.$("#TopDiv").find("#DivItems");

}

else {

divItems = $("#DivItems");

}

divItems.empty(); // error hit here.

divItems.append(result);

}

});

}

UPDATE #2

I updated the sample code for more information. Also, I placed where the error occurred but I don't know why it hit there. It should clear out the items only.

UPDATE #3

Based on Jacob's reply, I got curious as to what is the protocol and port numbers of the two iframe src's. Below is the result based on the console.

jDPrU.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值