Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q722 Is there any way I can share the window object amongst all of my webpages, so that the window gets created only once, and I can just call window.focus() to pop it up every time, no matter which page the user chooses it from?

You are here: irt.org | FAQ | JavaScript | Window | Q722 [ previous next ]

Yes, place the JavaScript code in the parent frameset and invoke it from there, for example:

<HTML>
<HEAD>
<SCRIPT>
handle = '';
function myOpen(url) {
    handle = window.open(url,....)
}
</SCRIPT>
</HEAD>

<FRAMESET>
...
</FRAMESET>
</HTML>

And then in any page:

<SCRIPT>
parent.myOpen('http://www.irt.org');
</SCRIPT>

Feedback on 'Q722 Is there any way I can share the window object amongst all of my webpages, so that the window gets created only once, and I can just call window.focus() to pop it up every time, no matter which page the user chooses it from?'

©2018 Martin Webb