Focus on second window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Cornford

    #16
    Re: Focus on second window

    Thomas 'PointedEars' Lahn wrote:
    <snip>[color=blue]
    > (<http://www.interhack.n et/pubs/munging-harmful/>)[/color]
    <snip>

    The arguments on that page are self-undermining. I wouldn't take its
    author seriously, you shouldn't expect anyone else to either.

    Richard.


    Comment

    • Lee

      #17
      Re: Focus on second window

      Thomas 'PointedEars' Lahn said:
      [color=blue][color=green]
      >> I don't believe that can happen in this case.[/color]
      >
      >What you believe is irrelevant. What specs and references say is
      >relevant. window.open() returns a reference to a Window object if
      >successful, `null' or at least not a Window object otherwise:[/color]

      That specification doesn't say that any browser will ever
      actually return null under any circumstances. It just says
      that that is what they should do if they cannot open a window.

      If I believed that it was at all likely for a browser to be
      unable to open a window and for my page to still be useful
      under those circumstances, it would be worth adding additional
      tests.

      [color=blue][color=green]
      >> There's nothing wrong with my From address, [...][/color]
      >
      >IBTD!
      >
      >| The "From" line contains the electronic mailing address of the
      >| person who sent the message, in the Internet syntax. [...]
      >(RFC 1036 "Standard for interchange of USENET messages", section 2.1.1)[/color]

      My From line does contain the electronic mailing address of the
      person who sent the message, but in a different syntax. One that
      requires the human who wants to send me mail to use common sense
      to make the necessary modification. Certainly you're not going
      to deny that this satisfies the intent of the RFC, are you?

      I'm not going to change it, even if you do.

      Comment

      • Grant Wagner

        #18
        Re: Focus on second window

        Lee wrote:
        [color=blue]
        > Thomas 'PointedEars' Lahn said:[color=green]
        > >
        > >Lee schrieb:[color=darkred]
        > >> DU said:
        > >>> Lee wrote:
        > >>>> [...] <a href="http://www.google.com" target="extern"
        > >>>> onclick="window .open(this.href ,'extern').focu s();return false">an[/color][/color]
        >[color=green]
        > >I don't agree with DU's other statements, however:
        > >
        > >Calling a method for an object, whose reference is returned by another
        > >method, without checking if the reference is valid and without checking
        > >if the object returned has the former method, is error-prone.[/color]
        >
        > Only if it's possible for the method to fail to return a valid
        > object. I don't believe that can happen in this case. If it
        > does, the page has more serious problems than simply calling a
        > non-existant method.[/color]

        <!-- THE FOLLOWING IS AUTO-GENERATED
        BY SOMELAMEPOPUPBL OCKER(tm) -->
        <SCRIPT Language="JavaS cript">
        <!-- HIDE FROM OLDER BROWSERS
        window.open = null;
        // -->
        </ScripT>
        ....

        Given the popup block attempt above, the following generates an error:
        <a href="..." target="..."
        onclick="
        window.open(thi s.href, this.target, ...).focus();re turn false;
        ">

        This code (an embelishment on Thomas' original suggestion) not only does not
        generate an error, it provides reliable fall-back to an HTML-only approach
        to open the new window
        <a href="..." target="..."
        onclick="
        if (window.open) {
        var w=window.open(t his.href, this.target, ...);
        if (w && !w.closed && w.focus) {
        w.focus();
        return false;
        }
        }
        return true;
        ">

        Although it's unlikely that any modern popup blocking mechanism would be so
        horribly implemented, the additional tests for !w.closed and w.focus may in
        fact notice other attempts (such as window.open = function() { return {}; })
        and will provide the HTML-only fall-back behaviour for those as well.
        Obviously any popup blocking attempt that allows the window to open, returns
        a viable window object and closes the window will (or may) not be caught by
        this code. As wouldn't any highly sophisticated popup blocking attempt that
        returned something that appeared to be a true window object but did not
        actually do anything.

        However, the above demonstrates why it's a wise choice to test all objects
        returned from methods before using them (and in fact why it's a wise idea to
        test components of the DOM before use as well), it also demonstrates that
        the simple act of checking for errors provides _additional_ functionality
        which was not initially planned for (noticing _some_ popup blocking).

        Obviously you can't catch everything, but what's the harm in trying? Now,
        rather then coding the above everytime you need to open a popup, why not:

        function openWindow(lnk, attributes, shouldFocus) {
        if (window.open) {
        var w = window.open(lnk .href, lnk.target, attributes);
        if (w && !w.closed && w.focus) {
        if (shouldFocus) {
        w.focus();
        }
        return false;
        }
        }
        return true;
        }

        <a href="..." target="..."
        onclick="return openWindow(this , '<attributes>' , true);">

        As your coding skills and perhaps our ability to detect popup blockers
        improves, additional code can be added to "openWindow ()" without affecting
        the existing functionality of pages that use it.

        --
        | Grant Wagner <gwagner@agrico reunited.com>

        * Client-side Javascript and Netscape 4 DOM Reference available at:
        *


        * Internet Explorer DOM Reference available at:
        *
        http://msdn.microsoft.com/workshop/a...ence_entry.asp

        * Netscape 6/7 DOM Reference available at:
        * http://www.mozilla.org/docs/dom/domref/
        * Tips for upgrading JavaScript for Netscape 7 / Mozilla
        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


        Comment

        • Grant Wagner

          #19
          Re: Focus on second window

          Thomas 'PointedEars' Lahn wrote:
          [color=blue][color=green]
          > > There's nothing wrong with my From address, [...][/color]
          >
          > IBTD!
          >
          > | The "From" line contains the electronic mailing address of the
          > | person who sent the message, in the Internet syntax. [...]
          > (RFC 1036 "Standard for interchange of USENET messages", section 2.1.1)
          >
          > <snip>
          > There is *everything* wrong with your From "address".[/color]

          So you blasted this newsgroup with 70 lines of OFF-TOPIC material (with 3 posts no less) to
          complain about the fact that you don't like his From: header? What's the matter with you, don't you
          see how totally _insane_ that is?

          It's like complaining about what the guy in front of you in a movie theatre is wearing by screaming
          at the top of your lungs. What he's wearing doesn't hurt you or impact you _directly_, it doesn't
          change his fashion sense, and it tends to annoy the other movie-goers.

          --
          | Grant Wagner <gwagner@agrico reunited.com>

          * Client-side Javascript and Netscape 4 DOM Reference available at:
          * http://devedge.netscape.com/library/...ce/frames.html
          * Internet Explorer DOM Reference available at:
          * http://msdn.microsoft.com/workshop/a...ence_entry.asp
          * Netscape 6/7 DOM Reference available at:
          * http://www.mozilla.org/docs/dom/domref/
          * Tips for upgrading JavaScript for Netscape 7 / Mozilla
          * http://www.mozilla.org/docs/web-deve...upgrade_2.html

          Comment

          • Lee

            #20
            Re: Focus on second window

            Grant Wagner said:[color=blue]
            >
            >Obviously you can't catch everything, but what's the harm in trying?[/color]

            Because trying to code defensively against such obscure
            situations is likely to lead to more problems than not.
            Look at how many more lines of code you've added.

            You need to draw a line in a reasonable place and accept
            that if the browser can't handle that level of code, the
            user must certainly be aware of its defects.

            I test for features that aren't supported in some of the
            more common browsers, and test for failure of methods to
            return objects when there seems to be a reason to suspect
            that they might fail, but I don't find it reasonable to
            test to see if the user has sabotaged his own browser.

            Comment

            • Richard Cornford

              #21
              Re: Focus on second window

              Lee wrote:
              <snip>[color=blue]
              > ... but I don't find it reasonable to
              > test to see if the user has sabotaged his own browser.[/color]

              Have you noticed the spate of questions along the lines of:-

              Q: "Pop-up windows no longer work on my browser, why is that?"

              - or:-

              Q: "Why is this unusual code appearing on all of the web
              sites I visit?"

              A: "You are running Norton Internet Security (or similar)."

              R: "Oh, I didn't know it did that".

              Some users clearly don't know they are sabotaging their own browser. It
              may not be unreasonable to make it their problem, but if you are trying
              to sell them things it probably is a good idea to try to accommodate
              them to the extent that it is feasible/practical because it is the
              seller who looses out in that relationship.

              It also makes me think that the recent survey quoting 14% for the use of
              pop-up blokers on the Internet could not have been very accurate as if
              the user's don't know they are using one how are they going to tell
              anyone else?

              Richard.


              Comment

              • Lee

                #22
                Re: Focus on second window

                Richard Cornford said:[color=blue]
                >
                >Lee wrote:
                ><snip>[color=green]
                >> ... but I don't find it reasonable to
                >> test to see if the user has sabotaged his own browser.[/color]
                >
                >Have you noticed the spate of questions along the lines of:-
                >
                >Q: "Pop-up windows no longer work on my browser, why is that?"
                >
                >- or:-
                >
                >Q: "Why is this unusual code appearing on all of the web
                > sites I visit?"
                >
                >A: "You are running Norton Internet Security (or similar)."
                >
                >R: "Oh, I didn't know it did that".
                >
                >Some users clearly don't know they are sabotaging their own browser. It
                >may not be unreasonable to make it their problem, but if you are trying
                >to sell them things it probably is a good idea to try to accommodate
                >them to the extent that it is feasible/practical because it is the
                >seller who looses out in that relationship.[/color]

                One of the most important rules of USENET is that the person
                who misspells "loses" loses the argument. However, you make
                an excellent case against using popups in web sites that are
                trying to sell things to ignorant users. Such sites should
                be as simple as possible to avoid any source of confusion.

                People who are capable of understanding that their popup
                blocker is broken shouldn't have that fact hidden from them.

                Comment

                • Thomas 'PointedEars' Lahn

                  #23
                  Re: Focus on second window

                  Lee schrieb:[color=blue]
                  > Thomas 'PointedEars' Lahn said:[color=green][color=darkred]
                  >>> There's nothing wrong with my From address, [...][/color]
                  >>
                  >> IBTD!
                  >>
                  >> | The "From" line contains the electronic mailing address of the |
                  >> person who sent the message, in the Internet syntax. [...] (RFC
                  >> 1036 "Standard for interchange of USENET messages", section 2.1.1)[/color]
                  >
                  > My From line does contain the electronic mailing address of the
                  > person who sent the message, [...][/color]

                  No, it does not. What part of "A mailbox receives mail." do I need
                  you to send as a presentation so that you can hopefully understand it?
                  [color=blue]
                  > but in a different syntax.[/color]

                  You are disregarding the (specified) syntax.
                  [color=blue]
                  > One that requires the human who wants to send me mail to use common
                  > sense to make the necessary modification. Certainly you're not going
                  > to deny that this satisfies the intent of the RFC, are you?[/color]

                  The RFC (1036, 2822) says nothing about humans interfering with headers,
                  it specifies data formats so that machines can transmit information
                  between people. The intention of these RFCs is to specify formats to
                  provide for interoperabilit y of the Net.

                  Besides, how you suggest a human will know what part of the munged
                  address that should be removed in order to send the e-mail to you?
                  By capitalizing it? You have not the slightest idea how the Internet
                  works. Take for example a person that does not understand the language
                  you have chosen to mung the address. And take for example my address:
                  It is valid, but if all people would follow your lousy excuse of
                  burdening others with your (spam) problems, they would remove the
                  "spam" substring and thus *make it invalid*.
                  [color=blue]
                  > [...] I'm not going to change it, even if you do.[/color]

                  Maybe you *are* going to change it. You are not only disregarding
                  the Netiquette Guidelines and violating Internet/Usenet standards
                  but (therefore) also the Acceptable Use Policy of your service provider.

                  Nuff said, score adjusted.


                  PointedEars

                  Comment

                  • Thomas 'PointedEars' Lahn

                    #24
                    Re: Focus on second window

                    Richard Cornford schrieb:[color=blue]
                    > Thomas 'PointedEars' Lahn wrote:
                    > <snip>[color=green]
                    >> (<http://www.interhack.n et/pubs/munging-harmful/>)[/color]
                    > <snip>
                    >
                    > The arguments on that page are self-undermining. [...]
                    > I wouldn't take its author seriously, you shouldn't expect
                    > anyone else to either.[/color]

                    That is a great beat-me-dead argument. If you have nothing
                    else to say I suggest you be quiet on the subject.


                    PointedEars

                    Comment

                    • Richard Cornford

                      #25
                      Re: Focus on second window

                      Lee wrote:[color=blue]
                      > Richard Cornford said:[/color]
                      <snip>[color=blue][color=green]
                      >>... looses ... .[/color]
                      >
                      > One of the most important rules of USENET is that the person
                      > who misspells "loses" loses the argument.[/color]

                      Fair enough, I concede. :)

                      Richard.



                      Comment

                      • Frederic Banaszak

                        #26
                        Re: Focus on second window

                        On Wed, 16 Jun 2004 13:47:37 +0200, Thomas 'PointedEars' Lahn
                        <PointedEars@nu rfuerspam.de> wrote:
                        [color=blue]
                        >Richard Cornford schrieb:[color=green]
                        >> Thomas 'PointedEars' Lahn wrote:
                        >> <snip>[color=darkred]
                        >>> (<http://www.interhack.n et/pubs/munging-harmful/>)[/color]
                        >> <snip>
                        >>
                        >> The arguments on that page are self-undermining. [...]
                        >> I wouldn't take its author seriously, you shouldn't expect
                        >> anyone else to either.[/color]
                        >
                        >That is a great beat-me-dead argument. If you have nothing
                        >else to say I suggest you be quiet on the subject.
                        >
                        >
                        >PointedEars[/color]


                        Oh, the irony...


                        Comment

                        • Lee

                          #27
                          Re: Focus on second window

                          Thomas 'PointedEars' Lahn said:[color=blue]
                          >
                          >Lee schrieb:[/color]
                          [color=blue][color=green]
                          >> My From line does contain the electronic mailing address of the
                          >> person who sent the message, [...][/color]
                          >
                          >No, it does not.[/color]

                          Obviously, it does.
                          I assume that you've even sent email to it, by now.

                          [color=blue][color=green]
                          >> but in a different syntax.[/color]
                          >
                          >You are disregarding the (specified) syntax.[/color]

                          Yes. Exactly. That's what I said.
                          I choose to disregard the syntax suggested in the RFC and use
                          one that is readable by [English speaking] humans, but generally
                          not by software. Any email sent by machines would be ignored,
                          anyway. You're complaining that I'm preventing messages that
                          would be ignored from arriving in my mailbox. Why do you care?
                          Aren't there some other windmills that you could be subduing?
                          [color=blue]
                          >Besides, how you suggest a human will know what part of the munged
                          >address that should be removed in order to send the e-mail to you?
                          >By capitalizing it? You have not the slightest idea how the Internet
                          >works. Take for example a person that does not understand the language
                          >you have chosen to mung the address. And take for example my address:
                          >It is valid, but if all people would follow your lousy excuse of
                          >burdening others with your (spam) problems, they would remove the
                          >"spam" substring and thus *make it invalid*.[/color]

                          Nothing that I've done suggests that it would be reasonable
                          for anybody to remove the "spam" substring from your message.
                          I capitalized the portion to be removed, as per the consensus
                          standard (I also replaced the letter "O" with a zero, just
                          in case the address harvesters catch on to that standard).

                          Finally, you need to think through the argument that people
                          who don't understand my language might have trouble parsing
                          my address in order to send me email. I don't think I need
                          to point out the flaw, do I?

                          Comment

                          • Lee

                            #28
                            Re: Focus on second window

                            Richard Cornford said:[color=blue]
                            >
                            >Lee wrote:[color=green]
                            >> Richard Cornford said:[/color]
                            ><snip>[color=green][color=darkred]
                            >>>... looses ... .[/color]
                            >>
                            >> One of the most important rules of USENET is that the person
                            >> who misspells "loses" loses the argument.[/color]
                            >
                            >Fair enough, I concede. :)[/color]

                            No! No!

                            You're supposed to complain about petty attacks on spelling
                            or grammar, and then I respond about how spelling and grammar
                            influence people's opinions, but misspelling at least one
                            word in the process.

                            Haven't you done this before?

                            Comment

                            • DU

                              #29
                              Re: Focus on second window

                              Thomas 'PointedEars' Lahn wrote:
                              [color=blue]
                              >
                              > Maybe you *are* going to change it. You are not only disregarding
                              > the Netiquette Guidelines and violating Internet/Usenet standards
                              > but (therefore) also the Acceptable Use Policy of your service provider.
                              >
                              > Nuff said, score adjusted.
                              >
                              >
                              > PointedEars[/color]

                              PointedEars, you like to spend an awful lot of time and typing on the
                              email address form of posters and at trying to tame them your way, on
                              proper etiquette. I think you miss the whole point of discussing and
                              posting in this newsgroup.

                              DU

                              Comment

                              • Richard Cornford

                                #30
                                Re: Focus on second window

                                Lee wrote:[color=blue]
                                > Richard Cornford said:[/color]
                                <snip>[color=blue][color=green]
                                >>Fair enough, I concede. :)[/color]
                                >
                                > No! No!
                                >
                                > You're supposed to complain about petty attacks on spelling
                                > or grammar, and then I respond about how spelling and grammar
                                > influence people's opinions, but misspelling at least one
                                > word in the process.[/color]

                                LOL
                                [color=blue]
                                > Haven't you done this before?[/color]

                                No, I never argue about spelling and grammar. I agree that they are
                                important, but I am dyslexic so I probably will never be good a
                                spelling, or learn the formal rules of English grammar. That leaves me
                                unqualified to argue either way so I don't argue at all. But I don't
                                mind having my mistakes pointed out (within reason) because that way I
                                can identify them and try to avoid repeating them.

                                Richard.


                                Comment

                                Working...