简体   繁体   English

javascript失败,权限被拒绝错误消息

[英]javascript failing with permission denied error message

I have a classic ASP web page that used to work... but the network guys have made a lot of changes including moving the app to winodws 2008 server running iis 7.5. 我有一个经典的ASP网页,以前可以工作...但是网络人员进行了很多更改,包括将应用程序移动到运行iis 7.5的winodws 2008服务器。 We also upgraded to IE 9. 我们还升级到IE 9。
I'm getting a Permission denied error message when I try to click on the following link: 尝试单击以下链接时,出现“拒绝权限”错误消息:

   <a href=javascript:window.parent.ElementContent('SearchCriteria','OBJECT=321402.EV806','cmboSearchType','D',false)>

But other links like the following one work just fine: 但是其他类似以下链接的链接也可以正常工作:

  <a href="javascript:ElementContent('SearchCriteria','OBJECT=321402.EV806', 'cmboSearchType','D',false)">

The difference is that the link that is failing is in an iframe. 区别在于发生故障的链接位于iframe中。 I noticed on other posts, it makes a difference whether or not the iframe content is coming from another domain. 我在其他帖子上注意到,iframe内容是否来自其他域会有所不同。 In my case, it's not. 就我而言,不是。 But I am getting data from another server by doing the following... 但是我通过执行以下操作从另一台服务器获取数据...

  set objhttp = Server.CreateObject("winhttp.winhttprequest.5.1")
  objhttp.open "get", strURL
  objhttp.send

and then i change the actual html that i get back ... add some hyperlinks etc. Then i save it to a file on my local server. 然后我更改返回的实际HTML ...添加一些超链接等。然后将其保存到本地服务器上的文件中。 (saved as *.html files) Then when my page is loading, i look for the specific html file and load it into the iframe. (另存为* .html文件),然后在加载页面时,查找特定的html文件并将其加载到iframe中。 I know some group policy options in IE have changed... and i'm looking into those changes. 我知道IE中的某些组策略选项已更改...我正在研究这些更改。 but the fact that one javascript link works makes me wonder whether the problem lies somewhere else...??? 但是一个JavaScript链接有效的事实使我怀疑问题是否出在其他地方... ??? any suggestions would be appreciated. 任何建议,将不胜感激。

thanks. 谢谢。

You could try with Msxml2.ServerXMLHTTP instead of WinHttp.WinHttpRequest. 您可以尝试使用Msxml2.ServerXMLHTTP而不是WinHttp.WinHttpRequest。 See differences between Msxml2.ServerXMLHTTP and WinHttp.WinHttpRequest? 看到Msxml2.ServerXMLHTTP和WinHttp.WinHttpRequest之间的区别吗? for the difference between Msxml2.ServerXMLHTTP. Msxml2.ServerXMLHTTP之间的区别。

On this exellent site about ASP you get plenty of codesamples on how to use Msxml2.ServerXMLHTTP which is the most recent of the two: http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html 在这个关于ASP的出色网站上,您可以获得有关如何使用Msxml2.ServerXMLHTTP的大量代码示例,这是两者中的最新版本: http ://classicasp.aspfaq.com/general/how-do-i-read-the-contents -of-a-remote-web-page.html

About the IE9 issue: connect a pc with an older IE or another browser to test if the browser that is the culprit. 关于IE9问题:将PC与较旧的IE或其他浏览器连接,以测试浏览器是否为罪魁祸首。 Also in IE9 (or better in Firefox/Firebug) use the development tools (F12) and watch the console for errors while the contents of the iFrame load. 同样在IE9中(或在Firefox / Firebug中更好),请使用开发工具(F12),并在控制台加载iFrame的内容时查看错误。

Your method to get dynamic pages is not efficient i'm afraid, ASP itself can do that and you could use eg a div instead of an iframe and replace the contents with what you get from the request. 恐怕您获取动态页面的方法效率不高,ASP本身可以做到这一点,您可以使用div代替iframe,然后将内容替换为从请求中获取的内容。 I will need to see more code to give better advice. 我将需要查看更多代码以提供更好的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM