Web Analytics Made Easy -
StatCounter "permission denied" reading window props - CodingForum

Announcement

Collapse
No announcement yet.

"permission denied" reading window props

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "permission denied" reading window props

    Newbie alert here....

    I'm about half way through the "JS Definitive Guide" and it's been going fine, until.... I got to all the code examples about creating new windows and then moving them, setting and reading properties. Whenever I try to run this in IE6 I get an "access is denied" error. So where the heck's the little checkbox I have to toggle on or off somewhere??

    Thanks.
    Composer
    New to the CF scene
    Last edited by Composer; Jun 30, 2002, 10:04 PM.

  • #2
    I stumbled into your very same problems with .... Netscape 7 (yeah, seven! the pre release: we have NN4.79, arguably leading to NN5, then NN6, NN6.2.3 and NN 7.0 No, comments not necessary LOL): it breaks up when attempting to read window.fullScreen: recognizes such object but denies the authorization: I had to work around it and bypass. Some properties seem just can't be inspected via scripting.

    You can have fun with my browser stripper to see what properties can be checked:
    http://www.unitedscripters.com/hotvamps/browsers.html

    Anyway if it is a pop up odds are that the code is wrong. Please post it, I hope tomorrow I remember to check or someone else may.

    ciao
    TrueLies
    New to the CF scene
    Last edited by TrueLies; Jun 30, 2002, 10:43 PM.
    Alberto http://www.unitedscripters.com/

    Comment


    • #3
      the "bad" code

      Well, I suppose it could be wrong. Here's the entire thing:

      <SCRIPT>
      var myWin = window.open("http://microsoft.com");
      var myLoc = myWin.location.toString();
      prompt (myLoc);
      </script>

      The new browser window opens as expected, but then I get:
      Runtime Error: Line 2 - Permission is denied.

      This is in IE 6.

      Help!

      Jeffery

      Comment


      • #4
        try this:

        <SCRIPT>
        var myWin = window.open("http://microsoft.com");
        var myLoc = myWin.location.href;

        </script>
        bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

        i am a loser geek, crazy with an evil streak,
        yes i do believe there is a violent thing inside of me.

        Comment


        • #5
          Thanks John.

          Your script:

          <SCRIPT>
          var myWin = window.open("http://microsoft.com");
          var myLoc = myWin.location.href;

          alert(myLoc);

          </script>

          Still gives me "permission denied".

          I am realizing now that I get two distinct messages, although I don't know what's different -- sometimes I get "permission denied" and others "access denied".

          I also tried Netscape 6.2 -- no error is reported but the alert displays "about: blank".

          Comment


          • #6
            sorry, dude, i wasn't paying enough attention before. i just noticed, you're opening microsoft.com in the other window. javascript has what's called the "same source" policy, where scripts can only work with pages that come from the same domain as themselves. you're never going to get a handle on that window, because with microsoft's page in it, it doesn't belong to you anymore. you'd have to have your own page in their to work with it.
            bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

            i am a loser geek, crazy with an evil streak,
            yes i do believe there is a violent thing inside of me.

            Comment


            • #7
              Ah ha!

              Thanks, John. That was it... he in fact explains that pretty clearly in the book, but it was one of those tidbits of information that I glossed over...

              Comment

              Working...
              X