Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JavaScript: Restrict with only one window popup

Posted on 2016-07-23
4
Medium Priority
?
65 Views
Last Modified: 2016-08-28
Hello Folks,

I've a website & with an option to open window popup.
I am able to open window popup & restricted with same popup (in case user click again to open window popup) but once request post then again, new popup opens (if user clicks on that option).

FYI, used
var newWindowpopup = null

checked for equal to null OR closed then open new window otherwise not

Open in new window


Do you have any thought to open same window popup (if already open) irrespective post to server? As you know, it should be browser compatibility.

Best Regards
0
Comment
Question by:MohitPandit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 2000 total points
ID: 41725615
The second argument of the window.open call is the name of the window:

window.open( url, name, specs, replace ) See: window.open on w3schools

If you use window.open(url1, "myWindow") and then later window.open(url2, "myWindow") then url2 should load in the earlier created window.

You can still assign the window to a variable such that later you can add focus to make the 2nd opening pop in front.
0
 
LVL 5

Author Comment

by:MohitPandit
ID: 41727594
I tried with that but once request post to server then variable of JavaScript initializes again & it doesn't work & open new window.

Best Regards
0
 
LVL 5

Accepted Solution

by:
MohitPandit earned 0 total points
ID: 41737269
I believe that it should be done with the help of cookies
0
 
LVL 5

Author Closing Comment

by:MohitPandit
ID: 41773563
thanks
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question