DotNetNuke 中的 jquery.min.js 文件的权限被拒绝
我创建了一些 jQuery 并将其放入 ascx 包含中。它在常规页面上运行良好,但是当我在网站上加载安全页面时,出现以下 javascript 错误。
没有权限 jquery.min.js 代码:0
有什么想法吗?
I have created some jQuery and put it in an ascx include. It works fine on regular pages, however when I load a secured page on my site I get the following javascript error.
Permission Denied
jquery.min.js
Code: 0
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设您使用的是 Google CDN 托管的 jQuery,您可以将托管脚本地址更改为使用 https 而不是 http:
Host ->主机设置->高级设置-> jQuery 设置 ->
参考
已更新
当您尝试使用 jQuery 从安全 URL (https) 向非安全 URL (http) 发出 $.ajax() 请求时,可能会发生此权限错误,即使它们是同一域 更改
url
参数以使用相对 URL 应该可以解决该问题。Assuming you're using the hosted jQuery by the Google CDN, you can change the hosted script address to use https instead of http:
Host -> Host Settings -> Advanced Settings -> jQuery Settings ->
References
Updated
This permissions error can occur when you're attempting to make an $.ajax() request using jQuery from a secure URL (https) to a non-secure URL (http) even though they are the same domain. Changing the
url
parameter to use a relative URL should fix the issue.您如何引用 jQuery min 文件?如果您使用库的完全限定 URL,并且该 URL 指定 HTTP 而不是 HTTPS,则这将导致您所描述的错误。
例如:
如果您的网站在 HTTPS 下提供服务,这将导致错误。
How are you referencing the jQuery min file? If you are using a fully qualified URL to the library, and that URL specifies HTTP rather than HTTPS, this would cause the error you describe.
For example:
This would cause errors if your site was being served under HTTPS.
根据我的经验,“权限被拒绝”错误来自于尝试访问与您位于不同域中的窗口。在您列出的代码中,ctl 是对弹出窗口的引用,还是对代码运行所在窗口以外的某个窗口的引用?如果该窗口位于 http://mysite.com 并且您的脚本在 https://mysite.com,您将收到“权限被拒绝”错误。
In my experience, the "Permission Denied" error comes from trying to access a window that is in a different domain than you. In the code that you listed, is
ctl
a reference to a popup window, or some window other than the window that the code is running in? If that window is at http://mysite.com and your script is running on https://mysite.com, you'll get the Permission Denied error.