Web Analytics Made Easy -
StatCounter Simultaneous Popup and PopUnder ??? - CodingForum

Announcement

Collapse
No announcement yet.

Simultaneous Popup and PopUnder ???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simultaneous Popup and PopUnder ???

    I have been working to resolve this issue for days, and I am extremely new at this so please don't be tempted to laugh at my code - I just don't know any better yet...

    I did post a question similar to this the other day, and while I appreciate those of you that responded, the responses were way over my head. (Even though I did mention I was a newbie)

    If anyone knows why this code isn't working, please do respond. Here is my code to try to get a popup from the main window and a popunder from the main window simultaneously.

    <body>

    <SCRIPT TYPE="text/javascript">
    <!--

    function popunder(link2, winname)
    {
    window.open("http://www.freeshipping.com","FreeShippingDomain")}
    window.focus()
    window.blur()
    //-->
    </SCRIPT>

    <A HREF="http://www.mypage.html" onClick="window.open('http://www.mypage.html','win1', 'width=310, height=440');return false" onmousedown="popunder('http://www.mypage2', 'win2'); return false">Click this link</A>

    </body>

    Again, assume I know almost nothing about javascript if you respond to this post... and thank you in advance for dumbing down the answer...

  • #2
    Meh. Why do you want to do popups and popunders anyway? Most browsers and/or users are savvy enough to avoid them. This isn't to be rude, let's call it "constructive criticism".

    Your problem likely stems from an event bubbling / timing issue.

    Comment


    • #3
      Ummm...the code
      Code:
      window.focus( );
      window.blur( );
      refers to the CURRENT WINDOW. That is, the window where the code is residing.

      So that code just brought the current window to the front and then immediately sent it to the rear.

      Thus guaranteeing the the window you THOUGHT you popped-under is now in front.
      Be yourself. No one else is as qualified.

      Comment


      • #4
        One more time, most modern browsers block unwanted pop-ups, and unwanted pop-ups are guaranteed to annoy and repel your visitors. You seem to think that having simultaneous pop-up and pop-under is cute. It is not - it is noobish and lame. In your own words, "I just don't know any better yet..."

        All the code given in this post has been tested and is intended to address the question asked.
        Unless stated otherwise it is not just a demonstration.

        Comment


        • #5
          wow

          You are truly a wonderful and helpful person Thank you so much for your very helpful comment.

          Comment


          • #6
            "I am not bound to please thee with my answer." - Shylock, "The Merchant of Venice Act 1", Shakespeare.

            All the code given in this post has been tested and is intended to address the question asked.
            Unless stated otherwise it is not just a demonstration.

            Comment

            Working...
            X