1

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. We also upgraded to 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. I noticed on other posts, it makes a difference whether or not the iframe content is coming from another domain. 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. (saved as *.html files) Then when my page is loading, i look for the specific html file and load it into the iframe. I know some group policy options in IE have changed... and i'm looking into those changes. but the fact that one javascript link works makes me wonder whether the problem lies somewhere else...??? any suggestions would be appreciated.

thanks.

dot
  • 14,928
  • 41
  • 110
  • 218
  • Ultimately from the _browser's_ point of view is both the IFrame holder and the content of the IFrame source from the same authority (authority is protocol:port//host/) – AnthonyWJones Jun 18 '12 at 20:54
  • so... sorry, can you just expand on what you mean? – dot Jun 19 '12 at 15:49
  • The most common reason why an access to window.parent is denied is because the site from which the parents contents has come from does not match the site that IFrame's content has come from. It could be that the IFrame contains content from "`https://mysite.com`" hosted in a parent window whose content comes from "`http://mysite.com`". Since these "authorities" do not match access to the window.parent object by code in the IFrame is blocked. – AnthonyWJones Jun 19 '12 at 17:28

1 Answers1

0

You could try with Msxml2.ServerXMLHTTP instead of WinHttp.WinHttpRequest. See differences between Msxml2.ServerXMLHTTP and WinHttp.WinHttpRequest? for the difference between 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

About the IE9 issue: connect a pc with an older IE or another browser to test if the browser that is the culprit. 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.

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. I will need to see more code to give better advice.

Community
  • 1
  • 1
peter
  • 41,770
  • 5
  • 64
  • 108
  • I don't see the relevance of ServerXMLHTTP vs WinHttpRequest to the question? – AnthonyWJones Jun 18 '12 at 21:32
  • well he could try ServerXMLHTTP but i would put more money on debugging and changing his way of presenting dynamic content – peter Jun 18 '12 at 21:57
  • I've tested with another browser.. where our gpo's are not enforced. the problem is still happening. so i guess it's not the browser. in ie 9 debug, it just says permission denied. in firefox, it says permission denied to access property 'ElementContent'. i'm going to google that and see what i find... – dot Jun 19 '12 at 16:02