|
|||||
|
|
#1 |
|
|
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 |
|
|
#2 |
|
|
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 |
|
|
#3 |
|
|
> 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/ |
|
|
#4 |
|
|
"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 |
|
|
#5 |
|
|
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 > > > > |
|
|
#6 |
|
|
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 > > |