Javascript Error: Access is denied

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HelenWu
    New Member
    • Oct 2006
    • 1

    #1

    Javascript Error: Access is denied

    I have two frames in index.html:
    <frameset cols="165,*">
    <frame name="NCTnav" src="NCTnavHome .htm" scrolling="auto ">
    <frame name="NCTmain" src="http://www.yahoo.com">
    </frameset>

    from frame "NCTnav", I have a link, when I click this link, I need to load http://www.google.com (for example) into frame "NCTmain". The code in NCTnavHome.htm like:

    <script language="JavaS cript" type="text/JavaScript">
    function displaySelectio n(URL) {
    window.parent.f rames[1].document.locat ion.href = URL;
    } // displaySelectio n
    </script>
    <TITLE>NCTnavHo me.htm</TITLE>
    </HEAD>
    <BODY>
    <A HREF="javascrip t:displaySelect ion('http://www.google.com' );">test</A>
    </BODY>
    </HTML>

    When I click this link, I got JavaScript error "Access is Denied". Even if I want to load a sample html on the web server instead of www.google.com, I got same error message. It seems no way to change url in one frame from a different frame.

    Can anybody help me on this issue?

    Thanks a lot in advance.
  • guest
    New Member
    • May 2006
    • 25

    #2
    It is not possible to manipulate pages in frames that are not in the same domain.

    Comment

    • eviva
      New Member
      • Apr 2007
      • 1

      #3
      HelenWu,

      Did you ever have a resolution to this problem? If so, can you please post how you resolved it? I am having the same problem with my page. Thanks in advance.

      eviva


      Originally posted by HelenWu
      I have two frames in index.html:
      <frameset cols="165,*">
      <frame name="NCTnav" src="NCTnavHome .htm" scrolling="auto ">
      <frame name="NCTmain" src="http://www.yahoo.com">
      </frameset>

      from frame "NCTnav", I have a link, when I click this link, I need to load http://www.google.com (for example) into frame "NCTmain". The code in NCTnavHome.htm like:

      <script language="JavaS cript" type="text/JavaScript">
      function displaySelectio n(URL) {
      window.parent.f rames[1].document.locat ion.href = URL;
      } // displaySelectio n
      </script>
      <TITLE>NCTnavHo me.htm</TITLE>
      </HEAD>
      <BODY>
      <A HREF="javascrip t:displaySelect ion('http://www.google.com' );">test</A>
      </BODY>
      </HTML>

      When I click this link, I got JavaScript error "Access is Denied". Even if I want to load a sample html on the web server instead of www.google.com, I got same error message. It seems no way to change url in one frame from a different frame.

      Can anybody help me on this issue?

      Thanks a lot in advance.

      Comment

      Working...