Access denied for location?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron

    Access denied for location?

    Hi,

    For some reason, when I create a new window using "myWin =
    window.open(url )", and then try to get the location of the window using
    "alert(myWin.lo cation)", it tells that access is denied. How can it be
    denied...it's a window I created...there fore, shouldn't I have access to
    it's location property?

    Thanks,
    Aaron


  • Hywel Jenkins

    #2
    Re: Access denied for location?

    In article <1fWdnQ0Kf6BELo HdRVn-hw@comcast.com> , agchandler@comc ast.net
    says...[color=blue]
    > Hi,
    >
    > For some reason, when I create a new window using "myWin =
    > window.open(url )", and then try to get the location of the window using
    > "alert(myWin.lo cation)", it tells that access is denied. How can it be
    > denied...it's a window I created...there fore, shouldn't I have access to
    > it's location property?[/color]

    The domain in the newly opened window is different from that of the
    original window.

    --
    Hywel I do not eat quiche


    Comment

    • Tim Williams

      #3
      Re: Access denied for location?

      If the document in the window is not in the same domain then you can't
      access it.
      This is a security/privacy issue.




      Tim


      "Aaron" <agchandler@com cast.net> wrote in message
      news:1fWdnQ0Kf6 BELoHdRVn-hw@comcast.com. ..[color=blue]
      > Hi,
      >
      > For some reason, when I create a new window using "myWin =
      > window.open(url )", and then try to get the location of the window[/color]
      using[color=blue]
      > "alert(myWin.lo cation)", it tells that access is denied. How can it[/color]
      be[color=blue]
      > denied...it's a window I created...there fore, shouldn't I have[/color]
      access to[color=blue]
      > it's location property?
      >
      > Thanks,
      > Aaron
      >
      >[/color]


      Comment

      • Aaron

        #4
        Re: Access denied for location?

        I understand what you're saying about security...but I'm reading O'Reilly's
        Javascript: The Definitive Guide to learn this (which is supposedly a good
        book), and there's a specific example where the location of another window
        (another frame in the same set) is obtained and written into the a text box
        of the current document. Why would this even be written if it's not
        possible?
        Also, I get the access denied message when I try to use a self-created "back
        button" in one frame to control another frames location via it's history
        object. This is in the book too, and it should work. Any ideas?

        Thanks,
        Aaron


        Comment

        • Richard Formby

          #5
          Re: Access denied for location?


          "Aaron" <agchandler@com cast.net> wrote in message
          news:PsydnVpkKP xEXYHdRVn_iw@co mcast.com...[color=blue]
          > I understand what you're saying about security...but I'm reading[/color]
          O'Reilly's[color=blue]
          > Javascript: The Definitive Guide to learn this (which is supposedly a good
          > book), and there's a specific example where the location of another window
          > (another frame in the same set) is obtained and written into the a text[/color]
          box[color=blue]
          > of the current document. Why would this even be written if it's not
          > possible?[/color]

          You believe *everything* you read?
          [color=blue]
          > Also, I get the access denied message when I try to use a self-created[/color]
          "back[color=blue]
          > button" in one frame to control another frames location via it's history
          > object. This is in the book too, and it should work. Any ideas?[/color]

          The book is wrong.


          Comment

          Working...