> Programming Languages > Javascript
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Javascript



Javascript - "about:blank?" in Programming Languages


Old 04-07-2004   #1
..r.. ..hwar..
 
Default about:blank?

I've cobbled together a script that should load a picture in a new,
automatically sized window. Because the image.height and image.width may be
0 if I test them right away, I use setTimeout to loop until they are both
not zero. I've run into two problems:

- In IE, the script doesn't seem to loop. If the picture isn't already
cached, nothing appears to happen; if it is in cache, the window (rather
slowly) opens up.

- In Netscape, the script also doesn't seem to loop properly. (Yes, I'll
revisit all of that.) However, even if the picture does pop up I get the
following message in the js console: Security Error: Content at
http://www.uahc.org/ct/ct015/photos2.html may not load data from
about:blank.

That last bit really puzzles me.

--
Regards,

Jerry Schwartz


 
Old 04-07-2004   #2
..o
 
Default Re: about:blank?

"Jerry Schwartz" <jerryschwartz@comfortable.com> wrote in message
news:NpKdndy7Yfszz-7dRVn-jg@comcast.com...
> - In Netscape, the script also doesn't seem to loop properly. (Yes, I'll
> revisit all of that.) However, even if the picture does pop up I get the
> following message in the js console: Security Error: Content at
> http://www.uahc.org/ct/ct015/photos2.html may not load data from
> about:blank.
>
> That last bit really puzzles me.


Cross-domain security rescrictions apply. The browser considers
http://ww.uahc.org and about: to be different domains, two different
protocols even, and refuses to communicate between them.
i guess you open the popup with
open('about:blank',...
Try
open('',...
instead.
HTH
Ivo


 
Old 04-07-2004   #3
..n.. ....
 
Default Re: about:blank?

Jerry Schwartz wrote:

> I've cobbled together a script that should load a picture in a new,
> automatically sized window. Because the image.height and image.width may be
> 0 if I test them right away, I use setTimeout to loop until they are both
> not zero. I've run into two problems:
>
> - In IE, the script doesn't seem to loop. If the picture isn't already
> cached, nothing appears to happen; if it is in cache, the window (rather
> slowly) opens up.
>
> - In Netscape, the script also doesn't seem to loop properly. (Yes, I'll
> revisit all of that.) However, even if the picture does pop up I get the
> following message in the js console: Security Error: Content at
> http://www.uahc.org/ct/ct015/photos2.html may not load data from
> about:blank.
>
> That last bit really puzzles me.


Its a cross-domain security issue. The reason is because about:blank is
not in the same domain as www.uahc.org so you get the security warning.
If you just want a blank page you can read/write to, create a blank.html
that is nothing but a blank page, load that page instead, and then you
can script it without the security warnings.


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
 
Old 04-07-2004   #4
..o
 
Default Re: about:blank?

"Jerry Schwartz" wrote
> even if the picture does pop up I get the
> following message in the js console: Security Error: Content at
> http://www.uahc.org/ct/ct015/photos2.html may not load data from
> about:blank.
>
> That last bit really puzzles me.


Cross-domain security rescrictions apply. The browser considers
http://ww.uahc.org and about: to be different domains, two different
protocols even, and refuses to communicate between them.
i guess you open the popup with
open('about:blank',...
Try
open('',...
instead.
HTH
Ivo




 
Old 04-07-2004   #5
..r.. ..hwar..
 
Default Re: about:blank?

I really shouldn't post when I'm tired... I'm not, myself, referenced
"about:blank" at all; but I think there's another bit of script in the page
(I inherited this web site) that might have been put there by FrontPage. I
need to look at it more thoroughly, and post a bit more intelligently.

--
Regards,

Jerry Schwartz
"Ivo" <no@thank.you> wrote in message
news:407365de$0$11058$a344fe98@news.wanadoo.nl...
> "Jerry Schwartz" wrote
> > even if the picture does pop up I get the
> > following message in the js console: Security Error: Content at
> > http://www.uahc.org/ct/ct015/photos2.html may not load data from
> > about:blank.
> >
> > That last bit really puzzles me.

>
> Cross-domain security rescrictions apply. The browser considers
> http://ww.uahc.org and about: to be different domains, two different
> protocols even, and refuses to communicate between them.
> i guess you open the popup with
> open('about:blank',...
> Try
> open('',...
> instead.
> HTH
> Ivo
>
>
>
>



 
Old 04-08-2004   #6
..r.. ..hwar..
 
Default Re: about:blank?

Well, I solved my problems. Thanks to those who had ideas, but all it really
took a good night's sleep and some thought. The whole thing revolved around
the question "Which variables are in scope when setTimeout evaluates its
argument?"

--
Regards,

Jerry Schwartz
"Jerry Schwartz" <jerryschwartz@comfortable.com> wrote in message
news:NpKdndy7Yfszz-7dRVn-jg@comcast.com...
> I've cobbled together a script that should load a picture in a new,
> automatically sized window. Because the image.height and image.width may

be
> 0 if I test them right away, I use setTimeout to loop until they are both
> not zero. I've run into two problems:
>
> - In IE, the script doesn't seem to loop. If the picture isn't already
> cached, nothing appears to happen; if it is in cache, the window (rather
> slowly) opens up.
>
> - In Netscape, the script also doesn't seem to loop properly. (Yes, I'll
> revisit all of that.) However, even if the picture does pop up I get the
> following message in the js console: Security Error: Content at
> http://www.uahc.org/ct/ct015/photos2.html may not load data from
> about:blank.
>
> That last bit really puzzles me.
>
> --
> Regards,
>
> Jerry Schwartz
>
>



 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0