Forbidden Access to Frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • A. Jamie Cuticchia

    Forbidden Access to Frame

    I have a webpage with 2 frames. Each frame accesses a different URL.
    When I try to run a javascript from Frame 1 to access content in Frame
    2, I get a forbidden error.

    Is there a solution to this?

    Thank you for your time and assistance.

    Jamie
  • Grant Wagner

    #2
    Re: Forbidden Access to Frame

    "A. Jamie Cuticchia" wrote:
    [color=blue]
    > I have a webpage with 2 frames. Each frame accesses a different URL.
    > When I try to run a javascript from Frame 1 to access content in Frame
    > 2, I get a forbidden error.
    >
    > Is there a solution to this?[/color]

    If both URLs are from the same domain, but different hosts, you could use
    document.domain to set them the same so cross-domain scripting security
    won't interfere. If they are from totally different domains, you are out
    of luck, JavaScript in one frame will not be able to access content in
    another.

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq


    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Forbidden Access to Frame

      A. Jamie Cuticchia wrote:[color=blue]
      > I have a webpage with 2 frames. Each frame accesses a different URL.
      > When I try to run a javascript from Frame 1 to access content in Frame
      > 2, I get a forbidden error.
      >
      > Is there a solution to this?[/color]

      Make both URIs of the same second level domain and set document.domain
      when required. (Groups-)Googling for "Same Origin Policy" will help.


      PointedEars

      Comment

      Working...