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 132309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:14:32+00:00 2026-05-11T06:14:32+00:00

I have an application that opens a new window on clicking a link. This

  • 0

I have an application that opens a new window on clicking a link. This spawns a page that holds a Java applet. The problem I am having is that clicking the same link reloads the page, which resets the Java application. Is there any way to trap this? Two solutions that would be acceptable are:

  1. Allow multiple windows to be opened from the click handler
  2. Ignore subsequent requests if the window is already open

Apologies for being a Javascript newbie – it’s not really my main thing.

The code attached to the handler is

function launchApplication(l_url, l_windowName) {   var l_width = screen.availWidth;   var l_height = screen.availHeight;    var l_params = 'status=1' +                  ',resizable=1' +                  ',scrollbars=1' +                  ',width=' + l_width +                  ',height=' + l_height +                  ',left=0' +                  ',top=0';    winRef = window.open(l_url, l_windowName, l_params);   winRef.moveTo(0,0);   winRef.resizeTo(l_width, l_height); } 

EDIT:

Thanks for the replies – I modified the suggestions slightly so that I could have more than one URL opened via the function.

EDIT2: There is another version of this code at Check for a URL open on another window

var g_urlarray = [];  Array.prototype.has = function(value) {     var i;     for (var i in this) {         if (i === value) {             return true;         }     }     return false; };   function launchApplication(l_url, l_windowName) {   var l_width = screen.availWidth;   var l_height = screen.availHeight;   var winRef;    var l_params = 'status=1' +                  ',resizable=1' +                  ',scrollbars=1' +                  ',width=' + l_width +                  ',height=' + l_height +                  ',left=0' +          ',top=0';   if (g_urlarray.has(l_url)) {     winRef = g_urlarray[l_url];   }   alert(winRef);   if (winRef == null || winRef.closed) {       winRef = window.open(l_url, l_windowName, l_params);       winRef.moveTo(0,0);       winRef.resizeTo(l_width, l_height);       g_urlarray[l_url] = winRef;   } } 
  • 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. 2026-05-11T06:14:33+00:00Added an answer on May 11, 2026 at 6:14 am

    I’d do it like this – basically store all the referenced opened windows on the function itself. When the function fires, check if the window doesn’t exist or has been close – of so, launch the popup. Otherwise, focus on the existing popup window for that request.

    function launchApplication(l_url, l_windowName) {   if ( typeof launchApplication.winRefs == 'undefined' )   {     launchApplication.winRefs = {};   }   if ( typeof launchApplication.winRefs[l_windowName] == 'undefined' || launchApplication.winRefs[l_windowName].closed )   {     var l_width = screen.availWidth;     var l_height = screen.availHeight;      var l_params = 'status=1' +                    ',resizable=1' +                    ',scrollbars=1' +                    ',width=' + l_width +                    ',height=' + l_height +                    ',left=0' +                    ',top=0';      launchApplication.winRefs[l_windowName] = window.open(l_url, l_windowName, l_params);     launchApplication.winRefs[l_windowName].moveTo(0,0);     launchApplication.winRefs[l_windowName].resizeTo(l_width, l_height);   } else {     launchApplication.winRefs[l_windowName].focus()   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html page that opens a new window and loads a basic
I have a VB.net test application that clicks a link that opens the Microsoft
I have an application window that displays a button. On button click, a new
I have an application window that displays a button. On button click, a new
I have a page on which is a link. This link opens a second
We have a Win32 application that hosts the .NET runtime and opens up .NET
I have a Windows shell script that opens an application. I'd like to modify
I have an application that uses window.open() to generate dynamic popups. Unfortunately, I've had
I have an MDI application that initially doesn't have the main window open. When
I'm writing in wpf. In my viewModel I have a command that opens new

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.