about:blank?

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

    #1

    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


  • Randy Webb

    #2
    Re: about:blank?

    Jerry Schwartz wrote:
    [color=blue]
    > 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.[/color]

    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.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • Ivo

      #3
      Re: about:blank?

      "Jerry Schwartz" <jerryschwartz@ comfortable.com > wrote in message
      news:NpKdndy7Yf szz-7dRVn-jg@comcast.com. ..[color=blue]
      > - 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.[/color]

      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:bla nk',...
      Try
      open('',...
      instead.
      HTH
      Ivo


      Comment

      • Ivo

        #4
        Re: about:blank?

        "Jerry Schwartz" wrote[color=blue]
        > 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.[/color]

        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:bla nk',...
        Try
        open('',...
        instead.
        HTH
        Ivo




        Comment

        • Jerry Schwartz

          #5
          Re: about:blank?

          I really shouldn't post when I'm tired... I'm not, myself, referenced
          "about:blan k" 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.n l...[color=blue]
          > "Jerry Schwartz" wrote[color=green]
          > > 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.[/color]
          >
          > 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:bla nk',...
          > Try
          > open('',...
          > instead.
          > HTH
          > Ivo
          >
          >
          >
          >[/color]


          Comment

          • Jerry Schwartz

            #6
            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:NpKdndy7Yf szz-7dRVn-jg@comcast.com. ..[color=blue]
            > 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[/color]
            be[color=blue]
            > 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
            >
            >[/color]


            Comment

            Working...