Announcement

Collapse
No announcement yet.

How Do I Get Links To Open In the Same Popup Window?

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

  • How Do I Get Links To Open In the Same Popup Window?

    Hi Guys,

    By default, the popup window function within the link menu produces a new window for each link that is clicked, so if I click 10 different links on my site it opens 10 individual browser windows one directly on top of another -- not desirable. How can I get my links to open in the same popup window, or else, how can a new popup close and replace the previous one?

    Thanks!
    Shawn A.

  • #2
    Re: How Do I Get Links To Open In the Same Popup Window?

    If you have that many links, you might be better off using an Iframe and stay on the same page??
    Have fun
    Regards..... David

    Step by Step Visual Tutorials for the complete beginner
    Newbies / Beginners Forum
    FREE Membership Login Scripts: - Meta Tags Analyzer
    My Social Networking Site - Free Contact Forms
    Finished your New website!! Now get it noticed Here:

    Comment


    • #3
      Re: How Do I Get Links To Open In the Same Popup Window?

      Why would you want yourpages to open in pop up windows? Are they not full pages but adds or forms? If they are full pages of content relating to your site, then have them all open in the same window (you will need full navagation on each page of course) leave the target area empty (nothing in it)
      Reguards
      Ed
      www.dsondesigns.com
      www.marseillesyouthsports.com
      www.300hitter.com
      www.bigjk.net
      How to add JAlbum to your site

      Comment


      • #4
        Re: How Do I Get Links To Open In the Same Popup Window?

        Hi Guys,

        Thanks for your quick replies. I'm not sure what an I frame is.

        Let me clarify my question -- I have an "About Us" page within my site that lists links to several of my clients' websites. When I click on each link one after another, I want each site to open within the same popup window, e.g., I don't want each click to open an additional popup window as it does now. Here's my web page, perhaps you can visit it to see what I'm talking about: http://www.caddesign.us/about%20us.html

        Thanks for your help,
        Shawn A.

        Comment


        • #5
          Re: How Do I Get Links To Open In the Same Popup Window?

          Well Normallly....after a popup is generated.. people click it closed..otherwise they most likely WOULD open in the the same window.

          Now do you mean open and stay on your site? Then that would be an iframe. They either have to open in a pop up.. a new window or iframe

          Karen

          VodaHost

          Your Website People!
          1-302-283-3777 North America / International
          02036089024 / United Kingdom
          291916438 / Australia

          ------------------------

          Top 3 Best Sellers

          Web Hosting - Unlimited disk space & bandwidth.

          Reseller Hosting - Start your own web hosting business.

          Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


          Comment


          • #6
            Re: How Do I Get Links To Open In the Same Popup Window?

            Hi Karen,

            Thanks for your explanation -- sounds like I need the Iframe setup. I will pursue this and if I run into any problems I'll let you know.

            Appreciated!
            Shawn A.

            Comment


            • #7
              Re: How Do I Get Links To Open In the Same Popup Window?

              I took a quick gander at your site and source code, and I would say no to the iframe. An iframe is an html element that embeds another html document directly in your webpage. It doesn't seem to fit with what you're doing.

              Everything works as it should, except one part:

              Code:
              function popupwnd(url, toolbar, menubar, locationbar, resize, scrollbars, statusbar, left, top, width, height)
              {
                 var popupwindow = this.open(url, '', 'toolbar=' + toolbar + ',menubar=' + menubar + ',location=' + locationbar + ',scrollbars=' + scrollbars + ',resizable=' + resize + ',status=' + statusbar + ',left=' + left + ',top=' + top + ',width=' + width + ',height=' + height);
              }
              here, your popupwindow variable is local, so you lose any reference to it when your function returns. Make it a global variable initialized to null, then either use window.open, if a popup hasn't been opened yet (i.e. the variable is still null) or change popupwindow.location if it has been opened. Here's an example that I'm using:

              Code:
              var newWindow = null;
              
              function view(url) {
              	if (newWindow == null || newWindow.closed) {
              		newWindow = window.open(url, '_blank');
              	} else {
              		newWindow.location = url;
              	}
              	newWindow.focus();
              	return false;
              }
              This code doesn't open the window in a popup, like yours; it simply opens a conventional window, which modern browsers usually put in a new tab. I would suggest for your usage that you actually do that instead, but a popup certainly isn't a sin. It's up to you.

              A couple notes about the code:
              -I used .closed to make sure that I didn't just change the location of a closed window. If you don't make this check, the window will still remain closed and your links won't appear to do anything if the user closes it when it first pops up.
              -All calls to this method should open the url in the same separate window, unless you refresh. Then a reference to the old window will be lost, and you won't be able to access it anymore. The code will simply use another new window to do the same thing.

              Comment

              Working...
              X