Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7518581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:46:11+00:00 2026-05-30T01:46:11+00:00

When you create a new browser window, you pass it a name like this:

  • 0

When you create a new browser window, you pass it a name like this:

myWindow = window.open('http://www.google.com', "googleWindow");

Later you can access the window from the variable you saved it as:

myWindow.close();

Is it possible to access and manipulate a window by it’s name (googleWindow) instead of the variable?

If it is not possible, what is the point giving windows names?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:46:11+00:00Added an answer on May 30, 2026 at 1:46 am

    No. Without a reference to the window, you can’t find it again, by name or otherwise. There is no collection of windows.

    UPDATE: Here’s how you could do it yourself:

    var windows = {};
    function openWindow(url, name, features) {
        windows[name] = window.open(url, name, features);
        return windows[name];
    }
    

    Now, openWindow will always open the window, and if the window already exists, it will load the given URL in that window and return a reference to that window. Now you can also implement findWindow:

    function findWindow(name) {
        return windows[name];
    }
    

    Which will return the window if it exists, or undefined.

    You should also have closeWindow, so you don’t keep references to windows that you opened yourself:

    function closeWindow(name) {
        var window = windows[name];
        if(window) {
            window.close();
            delete windows[name];
        }
    }
    

    If it is not possible, what is the point giving windows names?

    The name is used internally by the browser to manage windows. If you call window.open with the same name, it won’t open a new window but instead load the URL into the previously opened window. There are a few more things, from MDN window.open():

    If a window with the name strWindowName already exists, then strUrl is loaded into the existing window. In this case the return value of the method is the existing window and strWindowFeatures is ignored. Providing an empty string for strUrl is a way to get a reference to an open window by its name without changing the window’s location. To open a new window on every call of window.open(), use the special value _blank for strWindowName.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a button that prints the current browser window. This
I use a combination of html/php and javascript to open a new browser window
I have html page with 2 links like <a href=http://www.w3schools.com/>Visit W3Schools</a> <a href=http://www.w4schools.com/>Visit W4Schools</a>
I have a big problem in website http://www.konasignature.com/ . While load my website in
Consider this jsfiddle: http://fiddle.jshell.net/maple/JbEJN/show/ (this is the result window, in order for replaceState to
My browser (firefox) prevents any popup from loading, and loads links that open new
I am trying to create a site-specific browser application. I've created a new Cocoa
I create new ASP.NET web application that use SMTP to send message. The problem
I create new desktop with CreateDesktop and want to get it's DC & RC.
How to create new PCL file similar to existing MS doc. I have MS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.