Why does adding http to window open cause problems?

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

    #1

    Why does adding http to window open cause problems?

    Hi,

    This works to maximize the window, but wants to load yahoo locally :
    C:\WINDOWS\Desk top\www.yahoo.com

    <html>
    <script type="text/javaScript">
    <!--
    function test() {
    qwe = window.open("ww w.yahoo.com","" );
    qwe.moveTo(0,0) ;
    qwe.resizeTo(sc reen.availWidth ,screen.availHe ight);
    }
    // -->
    </script>
    <a href = "javascript:voi d(0)" onClick="test() ">test</a>

    Adding http:// before the www.yahoo.com opens to yahoo, but IE 5.5
    gives an error "access is denied" upon hitting the qwe.moveTo line.

    What's the deal-e-o here? Anyone have a clue what I've screwed up?

    oj
  • Mosley Jones III

    #2
    Re: Why does adding http to window open cause problems?


    "OJ" <orljustin@aol. com> wrote in message
    news:77d3a68b.0 307221837.10585 3ea@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > This works to maximize the window, but wants to load yahoo locally :
    > C:\WINDOWS\Desk top\www.yahoo.com
    >
    > <html>
    > <script type="text/javaScript">
    > <!--
    > function test() {
    > qwe = window.open("ww w.yahoo.com","" );
    > qwe.moveTo(0,0) ;
    > qwe.resizeTo(sc reen.availWidth ,screen.availHe ight);
    > }[/color]



    I just coped your code,


    my guess is that you don't have the permission to mess with a page not in
    your domain.



    [color=blue]
    > // -->
    > </script>
    > <a href = "javascript:voi d(0)" onClick="test() ">test</a>
    >
    > Adding http:// before the www.yahoo.com opens to yahoo, but IE 5.5
    > gives an error "access is denied" upon hitting the qwe.moveTo line.
    >
    > What's the deal-e-o here? Anyone have a clue what I've screwed up?
    >
    > oj[/color]


    Comment

    • ManoDestra

      #3
      Re: Why does adding http to window open cause problems?

      I know it's frustrating. It looks on the surface that you should be able to
      do it. Unfortunately as soon as you load a page from a different domain into
      that window. The window expects javascript from that domain to act on it,
      not from your domain whether it is just trying to move the window, or find
      out the number of links on the page.

      Annoying, but sensible if you think about it from a security point of view.

      Peter.
      "OJ" <orljustin@aol. com> wrote in message
      news:77d3a68b.0 307230331.180b2 484@posting.goo gle.com...[color=blue]
      > "Mosley Jones III" <me@info.gov.ma rs> wrote in message[/color]
      news:<3f1e1713$ 2@funnel.arach. net.au>...[color=blue][color=green]
      > > "OJ" <orljustin@aol. com> wrote in message
      > > news:77d3a68b.0 307221837.10585 3ea@posting.goo gle.com...[color=darkred]
      > > > Hi,
      > > >
      > > > This works to maximize the window, but wants to load yahoo locally :
      > > > C:\WINDOWS\Desk top\www.yahoo.com
      > > >
      > > > <html>
      > > > <script type="text/javaScript">
      > > > <!--
      > > > function test() {
      > > > qwe = window.open("ww w.yahoo.com","" );
      > > > qwe.moveTo(0,0) ;
      > > > qwe.resizeTo(sc reen.availWidth ,screen.availHe ight);
      > > > }[/color]
      > >
      > >
      > >
      > > I just coped your code,
      > >
      > >
      > > my guess is that you don't have the permission to mess with a page not[/color][/color]
      in[color=blue][color=green]
      > > your domain.[/color]
      >
      > Hi,
      >
      > I'm not messing with it. The browser should only care about moving
      > the window, not what's in it.
      >
      > oj[color=green]
      > >
      > >
      > >
      > >[color=darkred]
      > > > // -->
      > > > </script>
      > > > <a href = "javascript:voi d(0)" onClick="test() ">test</a>
      > > >
      > > > Adding http:// before the www.yahoo.com opens to yahoo, but IE 5.5
      > > > gives an error "access is denied" upon hitting the qwe.moveTo line.
      > > >
      > > > What's the deal-e-o here? Anyone have a clue what I've screwed up?
      > > >
      > > > oj[/color][/color][/color]


      Comment

      • ManoDestra

        #4
        Re: Why does adding http to window open cause problems?

        You need to specify the protocol you are using. If you don't, the browser
        will default to something (in this case, the file: protocol).

        I suspect your moveTo problem is because your trying to execute a bit of
        JavaScript across domains which is not allowed for security reasons. Try it
        on a page within your own domain or from your file system and it should
        work.

        Peter.
        "OJ" <orljustin@aol. com> wrote in message
        news:77d3a68b.0 307221837.10585 3ea@posting.goo gle.com...[color=blue]
        > Hi,
        >
        > This works to maximize the window, but wants to load yahoo locally :
        > C:\WINDOWS\Desk top\www.yahoo.com
        >
        > <html>
        > <script type="text/javaScript">
        > <!--
        > function test() {
        > qwe = window.open("ww w.yahoo.com","" );
        > qwe.moveTo(0,0) ;
        > qwe.resizeTo(sc reen.availWidth ,screen.availHe ight);
        > }
        > // -->
        > </script>
        > <a href = "javascript:voi d(0)" onClick="test() ">test</a>
        >
        > Adding http:// before the www.yahoo.com opens to yahoo, but IE 5.5
        > gives an error "access is denied" upon hitting the qwe.moveTo line.
        >
        > What's the deal-e-o here? Anyone have a clue what I've screwed up?
        >
        > oj[/color]


        Comment

        • OJ

          #5
          Re: Why does adding http to window open cause problems?

          "ManoDestra " <manodestra.sof tware@ntlworld. com> wrote in message news:<BcGTa.652 $c17.532283@new sfep1-win.server.ntli .net>...[color=blue]
          > I know it's frustrating. It looks on the surface that you should be able to
          > do it. Unfortunately as soon as you load a page from a different domain into
          > that window. The window expects javascript from that domain to act on it,
          > not from your domain whether it is just trying to move the window, or find
          > out the number of links on the page.
          >
          > Annoying, but sensible if you think about it from a security point of view.
          >
          > Peter.[/color]

          Hey,

          So, instead, I will try to open a window with no address, move it and
          then document.locati on it to send it to the other address.

          oj
          [color=blue]
          > "OJ" <orljustin@aol. com> wrote in message
          > news:77d3a68b.0 307230331.180b2 484@posting.goo gle.com...[color=green]
          > > "Mosley Jones III" <me@info.gov.ma rs> wrote in message[/color]
          > news:<3f1e1713$ 2@funnel.arach. net.au>...[color=green][color=darkred]
          > > > "OJ" <orljustin@aol. com> wrote in message
          > > > news:77d3a68b.0 307221837.10585 3ea@posting.goo gle.com...
          > > > > Hi,
          > > > >
          > > > > This works to maximize the window, but wants to load yahoo locally :
          > > > > C:\WINDOWS\Desk top\www.yahoo.com
          > > > >
          > > > > <html>
          > > > > <script type="text/javaScript">
          > > > > <!--
          > > > > function test() {
          > > > > qwe = window.open("ww w.yahoo.com","" );
          > > > > qwe.moveTo(0,0) ;
          > > > > qwe.resizeTo(sc reen.availWidth ,screen.availHe ight);
          > > > > }
          > > >
          > > >
          > > >
          > > > I just coped your code,
          > > >
          > > >
          > > > my guess is that you don't have the permission to mess with a page not[/color][/color]
          > in[color=green][color=darkred]
          > > > your domain.[/color]
          > >
          > > Hi,
          > >
          > > I'm not messing with it. The browser should only care about moving
          > > the window, not what's in it.
          > >
          > > oj[color=darkred]
          > > >
          > > >
          > > >
          > > >
          > > > > // -->
          > > > > </script>
          > > > > <a href = "javascript:voi d(0)" onClick="test() ">test</a>
          > > > >
          > > > > Adding http:// before the www.yahoo.com opens to yahoo, but IE 5.5
          > > > > gives an error "access is denied" upon hitting the qwe.moveTo line.
          > > > >
          > > > > What's the deal-e-o here? Anyone have a clue what I've screwed up?
          > > > >
          > > > > oj[/color][/color][/color]

          Comment

          Working...