window.location -- in a blank window....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frances Del Rio

    window.location -- in a blank window....

    I'm trying to open a url in a new window while pg loads (but NOT in a
    pop-up..) I need to do sthg like

    // while pg is loading..

    window.location ='page.html'
    // but I need this to open in a new blank window..
    // (NOT in a pop-up, a regular new window..)

    can you do this?? thank you..

    Frances Del Rio

  • David Dorward

    #2
    Re: window.location -- in a blank window....

    Frances Del Rio wrote:
    [color=blue]
    > I'm trying to open a url in a new window while pg loads (but NOT in a
    > pop-up..)[/color]

    That is a contradiction in terms. Opening a URI in a new window IS a popup.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Grant Wagner

      #3
      Re: window.location -- in a blank window....

      Frances Del Rio wrote:
      [color=blue]
      > I'm trying to open a url in a new window while pg loads (but NOT in a
      > pop-up..) I need to do sthg like
      >
      > // while pg is loading..
      >
      > window.location ='page.html'
      > // but I need this to open in a new blank window..
      > // (NOT in a pop-up, a regular new window..)
      >
      > can you do this?? thank you..
      >
      > Frances Del Rio[/color]

      The only difference between a "popup" and a "new windows" is the name. A
      popup is a new window, a new window is a popup.

      If you want a new window using JavaScript, just use:

      window.open('pa ge.html', 'windowName');

      By not specifying a third parameter, you should get a new window with the
      default size, position and chrome.

      --
      Grant Wagner <gwagner@agrico reunited.com>
      comp.lang.javas cript FAQ - http://jibbering.com/faq


      Comment

      • Frances Del Rio

        #4
        Re: window.location -- in a blank window....

        [color=blue]
        > The only difference between a "popup" and a "new windows" is the name. A
        > popup is a new window, a new window is a popup.[/color]

        Excuse me?? there is quite a difference between the two, it seems to me..
        a new blank window (opened with a regular <a href="#" target="_blank" >)
        tag will not be blocked by pop-up blockers... a pop-up window opened
        with the window.open() method will.. (apart from other differences,
        like for example in a pop-up you can customize how much chrome you
        include, in a new blank window you can't.. the way you resize them (you
        can resize a new blank window, but it's done differently from how you do
        it in a pop-up, where you do it in args in window.open() method..)

        at work we use pop-ups for legitimate reasons, not for advertising...
        but we've started to come up against pop-up blockers.. I thought we
        could open new blank windows instead, which is very simple, except if
        you're trying to do window.location upon loading and need this location
        to open in a new blank window instead of in same window (the way you
        would do in <a href="#" target="_blank" > thank you all for your
        response.. still am hoping to find a solution to this problem.. Frances

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: window.location -- in a blank window....

          Frances Del Rio <fdr58@yahoo.co m> writes:
          [color=blue]
          > Excuse me?? there is quite a difference between the two, it seems to me..
          > a new blank window (opened with a regular <a href="#"
          > target="_blank" >) tag will not be blocked by pop-up blockers... a
          > pop-up window opened with the window.open() method will..[/color]

          That dependes on the popup blocker. Some block any new window, no
          matter how it was created. Some won't block all script-derived new
          windows. Some block windows depending on whether they come from
          a user interaction or not.
          [color=blue]
          > at work we use pop-ups for legitimate reasons, not for
          > advertising... but we've started to come up against pop-up blockers..[/color]

          Fighting against popup-blockers is a losing battle. (That makes it
          winning, for us on the other side :)
          [color=blue]
          > I thought we could open new blank windows instead, which is very
          > simple,[/color]

          So, this should create a "non-popup" popup:

          <a href="somelink. html" target="winname " id="foo"></a>
          <script type="text/javascript">
          document.links['foo'].click();
          </script>

          My bet at least some popup-blocker will block that too ...

          and testing ...

          Yes, blocked in Mozilla FireFox. Not blocked in Opera (damn!). No
          blocker in IE yet.
          [color=blue]
          > except if you're trying to do window.location upon loading and
          > need this location to open in a new blank window instead of in same
          > window[/color]

          Hmm, I don't think I understand what you are trying to do.

          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          • kaeli

            #6
            Re: window.location -- in a blank window....

            In article <2mameiFl82ibU1 @uni-berlin.de>, fdr58@yahoo.com enlightened
            us with...[color=blue]
            >[color=green]
            > > The only difference between a "popup" and a "new windows" is the name. A
            > > popup is a new window, a new window is a popup.[/color]
            >
            > Excuse me?? there is quite a difference between the two, it seems to me..
            > a new blank window (opened with a regular <a href="#" target="_blank" >)[/color]

            That's HTML, not javascript.
            And its use is discouraged on the internet. The internet is accessible
            by many user agents, not just MSIE browser. ;)
            Actually, if you used a strict doctype, you wouldn't be able to use the
            target anyway. (You ARE using a doctype, right?)

            A popup is any window opened by script, be it javascript or vbscript or
            Flash. Unrequested popups are the ones people block most often. That
            means they opened without the user clicking on anything or initiating
            some event.
            A "new window" doesn't even exist in some user agents.

            As to blockers, MOST won't block a new window opened as a direct result
            of a user click, mouse action, or keypress. Perhaps your functions need
            a re-write. You should not be opening unrequested windows. The function
            that is fired when the user clicks has to be the one with the open in
            it. I've had the most luck doing that, but my main browsers of concern
            are Mozilla/Netscape/Firefox/Opera with the option to disallow
            unrequested popups. I have not tested that in all the blockers available
            for MSIE. Some of them block ALL calls to window.open.

            Note that giving something a target in HTML doesn't guarantee it will
            open in a new window. I can change that with my browser (mozilla) and
            open it in a tab or set it to open in the current window and ignore your
            target.

            The only way to open a window in javascript is with window.open. There
            is no magic other way that won't be blocked.

            I have yet to see something that uses popups that truly requires them.

            --
            --
            ~kaeli~
            A hangover is the wrath of grapes.



            Comment

            • Grant Wagner

              #7
              Re: window.location -- in a blank window....



              Frances Del Rio wrote:
              [color=blue][color=green]
              > > The only difference between a "popup" and a "new windows" is the name. A
              > > popup is a new window, a new window is a popup.[/color]
              >
              > Excuse me?? there is quite a difference between the two, it seems to me..
              > a new blank window (opened with a regular <a href="#" target="_blank" >)
              > tag will not be blocked by pop-up blockers... a pop-up window opened
              > with the window.open() method will..[/color]

              No, there is no difference between a new window and a popup.

              There is a difference between a window opened by the browser as a result of
              specifying a TARGET attribute on an <A> tag and a window opened
              programmaticall y using client-side JavaScript.

              There is even a difference between programmaticall y opened windows that were
              opened as the result of some user action (such as clicking a link) and
              programmaticall y opened windows which opened as the result of event beyond the
              user's control (such as the page loading). In some cases a "popup blocker"
              will block the latter, but not the former, in other cases, a "popup blocker"
              considers them both unacceptable.

              As for myself, my "popup blocking mechanism" even considers <a href="..."
              target="_blank" > unacceptable and refuses to open such links in a new window
              unless I specifically allow it.
              [color=blue]
              > at work we use pop-ups for legitimate reasons, not for advertising...
              > but we've started to come up against pop-up blockers.. I thought we
              > could open new blank windows instead, which is very simple, except if
              > you're trying to do window.location upon loading and need this location
              > to open in a new blank window instead of in same window (the way you
              > would do in <a href="#" target="_blank" > thank you all for your
              > response.. still am hoping to find a solution to this problem.. Frances[/color]

              As has already been discussed, there is no solution. Stop using
              programmaticall y opened windows. Or stop using code that opens new windows
              without the user explicitly requesting one (which will get you past some, but
              not all "popup blockers"). Ultimately you will have to abandon any attempt to
              control your users' desktops, so you may as well start now instead of trying
              to find a bubblegum and paperclip solution to the problem.

              --
              Grant Wagner <gwagner@agrico reunited.com>
              comp.lang.javas cript FAQ - http://jibbering.com/faq


              Comment

              • Richard Cornford

                #8
                Re: window.location -- in a blank window....

                Frances Del Rio wrote:[color=blue][color=green]
                >> The only difference between a "popup" and a "new windows" is
                >> the name. A popup is a new window, a new window is a popup.[/color]
                >
                > Excuse me?? there is quite a difference between the two, it seems
                > to me.. a new blank window (opened with a regular <a href="#"
                > target="_blank" >) tag will not be blocked by pop-up blockers...
                > a pop-up window opened with the window.open() method will..[/color]
                <snip>

                The last resort of those that will not abandon the practice of
                attempting to open new windows is to appeal to the notion of the
                "requested" pop-up. Unfortunately different pop-up blocking mechanisms
                have different notions of what is to be considered "requested" and some
                make no distinction at all:-

                <URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

                Richard.


                Comment

                • Frances Del Rio

                  #9
                  Re: window.location -- in a blank window....


                  ok, I thank everyone for their comments/feedback... but I'd like to say
                  that where I work, we're an internet co. that mainly produces webcasts
                  for Fortune 500 cos., trade associations, some non-profits... we use
                  pop-ups for the video displays, we open a window that's approx 790x530,
                  on the left side is the video, on the right images that flip (or are
                  flipped by user) as video progresses.. this is a perfectly legitimate
                  use of pop-up windows.. there's no way we can do this in same window
                  where users register, login, etc (that has a nav frame on the left and
                  on main frame pgs for registration, login, etc..) if you go to
                  www.foxnews.com and scroll down to where it says "News 24/7" and click
                  on a video link you will see what I mean.. our media viewer windows are
                  more or less the same size, and have a similar layout (ours look better,
                  though.. ;) and of course they have no advertising..)

                  so: yes, it IS a drag that advertisers are abusing this function,
                  because I personally find pop-ups really neat, I think you can design
                  good UI w/them if you use them right.. I have been doing HTML for about
                  10 years now, and have used them a lot in my personal website also
                  (www.francesdelrio.com) (& practically all of them are opened by user..)

                  and the thing is, going back to my situation at work, if a user goes to
                  main page and our sw detects this user is already registered and we have
                  their password stored or whatever this video viewer pops up
                  automatically, w/out any input from user, while pg is still loading in
                  many cases.. this is where the problem arises.. so I came up w/idea
                  that instead of a pop-up opened w/window.open() method we could open the
                  video viewer in a regular new blank window, <a href="__"
                  target="_blank" > and resize... but how do you do this while page is
                  loading (w/o input from user??)

                  ok, I think I've written enough for now... ;)

                  Frances



                  kaeli wrote:
                  [color=blue]
                  > In article <2mameiFl82ibU1 @uni-berlin.de>, fdr58@yahoo.com enlightened
                  > us with...
                  >[color=green][color=darkred]
                  >>>The only difference between a "popup" and a "new windows" is the name. A
                  >>>popup is a new window, a new window is a popup.[/color]
                  >>
                  >>Excuse me?? there is quite a difference between the two, it seems to me..
                  >>a new blank window (opened with a regular <a href="#" target="_blank" >)[/color]
                  >
                  >
                  > That's HTML, not javascript.
                  > And its use is discouraged on the internet. The internet is accessible
                  > by many user agents, not just MSIE browser. ;)
                  > Actually, if you used a strict doctype, you wouldn't be able to use the
                  > target anyway. (You ARE using a doctype, right?)
                  >
                  > A popup is any window opened by script, be it javascript or vbscript or
                  > Flash. Unrequested popups are the ones people block most often. That
                  > means they opened without the user clicking on anything or initiating
                  > some event.
                  > A "new window" doesn't even exist in some user agents.
                  >
                  > As to blockers, MOST won't block a new window opened as a direct result
                  > of a user click, mouse action, or keypress. Perhaps your functions need
                  > a re-write. You should not be opening unrequested windows. The function
                  > that is fired when the user clicks has to be the one with the open in
                  > it. I've had the most luck doing that, but my main browsers of concern
                  > are Mozilla/Netscape/Firefox/Opera with the option to disallow
                  > unrequested popups. I have not tested that in all the blockers available
                  > for MSIE. Some of them block ALL calls to window.open.
                  >
                  > Note that giving something a target in HTML doesn't guarantee it will
                  > open in a new window. I can change that with my browser (mozilla) and
                  > open it in a tab or set it to open in the current window and ignore your
                  > target.
                  >
                  > The only way to open a window in javascript is with window.open. There
                  > is no magic other way that won't be blocked.
                  >
                  > I have yet to see something that uses popups that truly requires them.
                  >[/color]

                  Comment

                  • Lasse Reichstein Nielsen

                    #10
                    Re: window.location -- in a blank window....

                    Frances Del Rio <fdr58@yahoo.co m> writes:
                    [color=blue]
                    > so I came up w/idea that instead of a pop-up opened w/window.open()
                    > method we could open the video viewer in a regular new blank window,
                    > <a href="__" target="_blank" > and resize... but how do you do this
                    > while page is loading (w/o input from user??)[/color]

                    You can *try*:

                    <a href="..." target="_blank" id="foo"></a>
                    <script type="text/javascript">
                    document.links['foo'].click();
                    </script>


                    Won't work in all browsers, though.
                    /L
                    --
                    Lasse Reichstein Nielsen - lrn@hotpop.com
                    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                    'Faith without judgement merely degrades the spirit divine.'

                    Comment

                    • Thomas 'PointedEars' Lahn

                      #11
                      Re: window.location -- in a blank window....

                      Frances Del Rio wrote:[color=blue]
                      > ok, I thank everyone for their comments/feedback... but I'd like to say
                      > that where I work, we're an internet co. that mainly produces webcasts
                      > for Fortune 500 cos., trade associations, some non-profits... we use
                      > pop-ups for the video displays, we open a window that's approx 790x530,[/color]

                      What if the user has a desktop size that does not allow such large windows
                      to be opened?
                      [color=blue]
                      > on the left side is the video, on the right images that flip (or are
                      > flipped by user) as video progresses.. this is a perfectly legitimate
                      > use of pop-up windows..[/color]

                      No, it is not. Pop-ups are a Bad Thing. They eat much more resources than
                      required if abandoned.
                      [color=blue]
                      > there's no way we can do this in same window where users register, login,[/color]

                      There is. You are obviously not competent enough to make design decisions.
                      Get yourself educated.
                      [color=blue]
                      > etc (that has a nav frame on the left and on main frame pgs for
                      > registration, login, etc..)[/color]

                      Frames are a Bad Thing. Use CSS and fixed layers instead.
                      This even works in IE with a small workaround.
                      [color=blue]
                      > if you go to www.foxnews.com and scroll down to where it says
                      > "News 24/7" and click on a video link you will see what I mean..[/color]

                      Doing Bad Things just because others do Bad Things has never been
                      a reasonable excuse, if that.
                      [color=blue]
                      > [more incompetent blabla][/color]

                      What you like or dislike is irrelevant. If you design/hack for a
                      customer, what the customer wants when it comes to such design
                      decisions should be irrelevant (and it is your job to explain why).
                      Functionality is relevant. The fish must eat the worm, not the
                      fisher.
                      [color=blue]
                      > and the thing is, going back to my situation at work, if a user goes to
                      > main page and our sw detects this user is already registered and we have
                      > their password stored or whatever this video viewer pops up
                      > automatically, w/out any input from user, while pg is still loading in
                      > many cases.. this is where the problem arises..[/color]

                      The problem arises *at least* with Windows XP Service Pack 2
                      which finally causes the (alas!) most used browser today to
                      block unrequested popups *by default*.
                      [color=blue]
                      > [...]
                      > ok, I think I've written enough for now... ;)
                      > [...][/color]

                      And if you would saved us from that top-post, too, as strongly
                      recommended in the FAQ, it would be more appreciated.


                      PointedEars

                      Comment

                      • Andrew Thompson

                        #12
                        Re: window.location -- in a blank window....

                        On Mon, 26 Jul 2004 05:52:31 +0200, Thomas 'PointedEars' Lahn wrote:
                        [color=blue]
                        > The problem arises *at least* with Windows XP Service Pack 2
                        > which finally causes the (alas!) most used browser today to
                        > block unrequested popups *by default*.[/color]

                        Cool. I had previously rejected any attempt
                        (by the system) to update.. But that one is
                        *worth* it! I hit a page the other day that
                        had 2 pop-ups and 3 pop-unders.. :-O

                        --
                        Andrew Thompson
                        http://www.PhySci.org/ Open-source software suite
                        http://www.PhySci.org/codes/ Web & IT Help
                        http://www.1point1C.org/ Science & Technology

                        Comment

                        • kaeli

                          #13
                          Re: window.location -- in a blank window....

                          In article <2mdd8mFlo8agU1 @uni-berlin.de>, fdr58@yahoo.com enlightened us
                          with...[color=blue]
                          >
                          > ok, I thank everyone for their comments/feedback... but I'd like to say
                          > that where I work, we're an internet co. that mainly produces webcasts
                          > for Fortune 500 cos., trade associations, some non-profits... we use
                          > pop-ups for the video displays, we open a window that's approx 790x530,
                          > on the left side is the video, on the right images that flip (or are
                          > flipped by user) as video progresses.. this is a perfectly legitimate
                          > use of pop-up windows..[/color]

                          Yes, it is, and it's used by a lot of multimedia and game sites, all of which
                          (from what I've noticed, anyway) have a disclaimer that effectively tells
                          people that they use popups and to turn off their blocker or control+click
                          (for some blockers) to allow the popups. :)
                          Heck, my favorite game spot uses popups and applets, two things I usually
                          tell people NOT to use. *smile*
                          If your content is worth it, you tell users about it and they'll decide they
                          like you enough to turn off blocking for you.

                          All blockers have a way to allow popups by some means. Some are
                          control+click, some you have to add the site to a list of allowed sites, etc.

                          There really isn't a good way around this issue. You just have to inform the
                          user about it and let them decide if they want to use your site by turning
                          off popup blocking or not.

                          My two cents...

                          --
                          --
                          ~kaeli~
                          Is it possible to be totally partial?



                          Comment

                          • Grant Wagner

                            #14
                            Re: window.location -- in a blank window....

                            Andrew Thompson wrote:
                            [color=blue]
                            > On Mon, 26 Jul 2004 05:52:31 +0200, Thomas 'PointedEars' Lahn wrote:
                            >[color=green]
                            > > The problem arises *at least* with Windows XP Service Pack 2
                            > > which finally causes the (alas!) most used browser today to
                            > > block unrequested popups *by default*.[/color]
                            >
                            > Cool. I had previously rejected any attempt
                            > (by the system) to update.. But that one is
                            > *worth* it! I hit a page the other day that
                            > had 2 pop-ups and 3 pop-unders.. :-O[/color]

                            Use a Gecko-based browser and get popup blocking built-in. Or if you
                            must use IE, install the Google toolbar <url: http://toolbar.google.com/
                            />. It blocks most (but not all) popups.

                            --
                            Grant Wagner <gwagner@agrico reunited.com>
                            comp.lang.javas cript FAQ - http://jibbering.com/faq


                            Comment

                            • Andrew Thompson

                              #15
                              Re: window.location -- in a blank window....

                              On Mon, 26 Jul 2004 15:13:21 GMT, Grant Wagner wrote:
                              [color=blue][color=green]
                              >> Cool. I had previously rejected any attempt
                              >> (by the system) to update.. (IE)[/color][/color]
                              [color=blue]
                              > Use a Gecko-based browser and get popup blocking built-in. Or if you
                              > must use IE,[/color]

                              b) Well, define 'must'? I have Moz/Opera/Lynx
                              installed for testing my pages, but use IE deliberately
                              so that I am aware of the quirks that may develop
                              between IE/Java*..

                              [ * I doubt we need to cover that ground again,
                              though there are some recent'ish developments that
                              I am not sure whether you are aware..
                              'unmsvm.exe/JVMClean'? ]
                              [color=blue]
                              >..install the Google toolbar <url: http://toolbar.google.com/
                              > />. It blocks most (but not all) popups.[/color]

                              Thanks for the tip, I will look into it..

                              (chuckles) Well now you mention it and I
                              look more closely at that link, it reminded
                              me of, ..yep there it is.
                              <http://groups.google.c om/groups?th=ff7d8 2172abe9b65>

                              Hey.. I keep trying to convince people that pop-ups
                              are going the way of the dinosaurs (..and I will
                              have to update some of *my* applets to suit..)

                              Old habits and ways die hard..

                              --
                              Andrew Thompson
                              http://www.PhySci.org/ Open-source software suite
                              http://www.PhySci.org/codes/ Web & IT Help
                              http://www.1point1C.org/ Science & Technology

                              Comment

                              Working...