• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is Child Window Open?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been searching for a while now on how to do this, and most say it can't be done.... There is always a way around that statement.

Once a window is open, using


Another window may not be allowed opened until that one is closed.

I've been attempting to send a var back to the parent when the child is closed using the onunload method, but with no luck. If I could just do that, then it could solve the problem.

But if anyone else has another idea, it's welcome.

And btw, developing in .Net and have a temporary fix working using an application var, but that has a security hole in it.

Thanks all,

Zath
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Java and JavaScript are two utterly and completely different and unrelated languages. The similar names are the invention of a marketing team. Your question is about JavaScript. Most of this site is about Java, not JavaScript -- but we do have one forum entitled "HTML and JavaScript". I'll move your question there for you.
 
Zath Misfit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, my mistake. After posting I was reading other posts and realized it was java, something I did a while back.

And to add more to my post, here is what I have been attempting...
On the parent or opener page.....

And on the child page....


I just can't seem to get the var to post back to the opener and not open another window if it's already open.

Thanks......

Zath
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said before whereever you posted this question before you do not need to set a variable since you can check the window object.

The following code checks to see if the window is open. If it is open, an alert message is displayed in the pop up. If it is not open, than a new window is opened up.



Eric
 
Zath Misfit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, on the asp.net site, but still can't get it to work right.

One the child page that is opening, in the on_load event, I set window.opener.winPop = true;

It never seems to set the var.

Suggestions?

Thanks,
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you do not need to set the varaiable winPop, the browser does it. The variable winPop holds a window object that holds the state of the browser window.

The thing is are you posting back the page to the server to open the new windows? If that is the case, then you are going to have issues since you loose the window object. There is no way to hold that.

Eric
 
Zath Misfit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, finally got it working!!!

and of course, since I'm using .Net, in the code behind to call the function....


Thanks for the help,

Zath
reply
    Bookmark Topic Watch Topic
  • New Topic