Forum Moderators: open
The browser has to check current window name, and if its different from the window name specified in the java script (window.open('somepage.html, 'pagename'...'), the the page should either close itself or redirect to another page, pointing visitor to the first page of the site to open the popup, the way it should be.
For instance, if user wants to see it in full screen, he copies the URL in the browser and page opens,a dn layout is screwed. I want to put a check on every page if the window name (popup name) is ... say "mypopup". I it is not, then window just closes.
This way I'll be able to restrict site navigation only within my popup.
There are several significant problems with what you're trying to do. The first is that if a user has Javascript disabled (as a small but significant percentage of users do), your site either won't work at all (the popup won't open and they are faced with a blank page), or at best you can't ensure the page will be displayed in a window of the "correct" dimensions.
A second problem is that your site is unlikely to be indexed by search engines.
Thirdly, even if a user has Javascript enabled, many have popup blockers which will mean your site again will be inaccessible to them (note that Windows XP service pack 2 is going to be out very soon, and it includes a popup blocker which I believe will be set on by default).
Finally, even if you were able to find a foolproof method of doing what you want, many users strongly dislike such methods, particularly resizing windows or forcing them to navigate in a separate window.
There are no easy shortcuts here - you will need to rethink your layout and approach if you want your site to have any chance of success.
[blue]<a href = "_pageURL_" onclick = "openWin('_pageURL');return false">[/blue] That should help, and will allow search engines to get to your page (but then you'll get even more people turning up there with the wrong window size ).
On the pop-up itself, if the pop has been done:
[blue]... open(" .. ","popup", " ...")[/blue] checking for the window name is as simple as:
[blue]if(this.name!= "popup")
// ..do this ..[/blue]
But you may not be allowed to close the window, at least without a user-confirmation.
Generally, I'd go with encyclo. It's just not worth all the potential bother.
[ I do hope that these default pop-up blockers will at least attempt to distinguish between a user-driven pop-up event and an automatic one ]