Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Why does adding http to window open cause problems?

Reply
Thread Tools

Why does adding http to window open cause problems?

 
 
OJ
Guest
Posts: n/a
 
      07-23-2003
Hi,

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

<html>
<script type="text/javaScript">
<!--
function test() {
qwe = window.open("www.yahoo.com","");
qwe.moveTo(0,0);
qwe.resizeTo(screen.availWidth,screen.availHeight) ;
}
// -->
</script>
<a href = "javascript:void(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
 
Reply With Quote
 
 
 
 
Mosley Jones III
Guest
Posts: n/a
 
      07-23-2003

"OJ" <> wrote in message
news: om...
> Hi,
>
> This works to maximize the window, but wants to load yahoo locally :
> C:\WINDOWS\Desktop\www.yahoo.com
>
> <html>
> <script type="text/javaScript">
> <!--
> function test() {
> qwe = window.open("www.yahoo.com","");
> qwe.moveTo(0,0);
> qwe.resizeTo(screen.availWidth,screen.availHeight) ;
> }




I just coped your code,


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




> // -->
> </script>
> <a href = "javascript:void(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



 
Reply With Quote
 
 
 
 
ManoDestra
Guest
Posts: n/a
 
      07-24-2003
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" <> wrote in message
news: om...
> Hi,
>
> This works to maximize the window, but wants to load yahoo locally :
> C:\WINDOWS\Desktop\www.yahoo.com
>
> <html>
> <script type="text/javaScript">
> <!--
> function test() {
> qwe = window.open("www.yahoo.com","");
> qwe.moveTo(0,0);
> qwe.resizeTo(screen.availWidth,screen.availHeight) ;
> }
> // -->
> </script>
> <a href = "javascript:void(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



 
Reply With Quote
 
ManoDestra
Guest
Posts: n/a
 
      07-24-2003
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" <> wrote in message
news: om...
> "Mosley Jones III" <> wrote in message

news:<3f1e1713$>...
> > "OJ" <> wrote in message
> > news: om...
> > > Hi,
> > >
> > > This works to maximize the window, but wants to load yahoo locally :
> > > C:\WINDOWS\Desktop\www.yahoo.com
> > >
> > > <html>
> > > <script type="text/javaScript">
> > > <!--
> > > function test() {
> > > qwe = window.open("www.yahoo.com","");
> > > qwe.moveTo(0,0);
> > > qwe.resizeTo(screen.availWidth,screen.availHeight) ;
> > > }

> >
> >
> >
> > I just coped your code,
> >
> >
> > my guess is that you don't have the permission to mess with a page not

in
> > your domain.

>
> Hi,
>
> I'm not messing with it. The browser should only care about moving
> the window, not what's in it.
>
> oj
> >
> >
> >
> >
> > > // -->
> > > </script>
> > > <a href = "javascript:void(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



 
Reply With Quote
 
OJ
Guest
Posts: n/a
 
      07-25-2003
"ManoDestra" <> wrote in message news:<BcGTa.652$>...
> 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.


Hey,

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

oj

> "OJ" <> wrote in message
> news: om...
> > "Mosley Jones III" <> wrote in message

> news:<3f1e1713$>...
> > > "OJ" <> wrote in message
> > > news: om...
> > > > Hi,
> > > >
> > > > This works to maximize the window, but wants to load yahoo locally :
> > > > C:\WINDOWS\Desktop\www.yahoo.com
> > > >
> > > > <html>
> > > > <script type="text/javaScript">
> > > > <!--
> > > > function test() {
> > > > qwe = window.open("www.yahoo.com","");
> > > > qwe.moveTo(0,0);
> > > > qwe.resizeTo(screen.availWidth,screen.availHeight) ;
> > > > }
> > >
> > >
> > >
> > > I just coped your code,
> > >
> > >
> > > my guess is that you don't have the permission to mess with a page not

> in
> > > your domain.

> >
> > Hi,
> >
> > I'm not messing with it. The browser should only care about moving
> > the window, not what's in it.
> >
> > oj
> > >
> > >
> > >
> > >
> > > > // -->
> > > > </script>
> > > > <a href = "javascript:void(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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Why does adding debug statements in an override class of http-access2 change it's outcome? Dan Kohn Ruby 0 01-19-2006 12:59 AM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM
window.open() doesn't open new Window in Opera PC HUA Javascript 2 05-19-2004 02:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57