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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 178k
  • Answers 178k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer How RTTI information is stored is an implementation detail and… May 12, 2026 at 3:40 pm
  • Editorial Team
    Editorial Team added an answer Not sure if this is exactly the right answer, but… May 12, 2026 at 3:40 pm
  • Editorial Team
    Editorial Team added an answer You should respond with a 503 Service Unavailable with a… May 12, 2026 at 3:40 pm

Related Questions

I have an MDI application that initially doesn't have the main window open. When
Question I have an application written in Java. It is designed to run on
I have a servlet that write a pdf file as a ByteArrayOutputStream to the
We're writing a Windows client application in VB.NET. On the first launch of the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.