Forum Moderators: open

Message Too Old, No Replies

keep site in popup

opening in other page not allowed

         

superpups

11:40 am on Jun 4, 2004 (gmt 0)

10+ Year Member



hello.
I'm making a website now and its in a fixed sized popup window. I have no problem navigating, however I would like to restrict opening site pages to current popup window name. Not because I dont want others to see my code or something, it just keeps the layout all together.

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.

korkus2000

1:05 pm on Jun 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You want to make sure that no matter what page a user comes in on that they are in your pop-up window?

superpups

2:45 pm on Jun 4, 2004 (gmt 0)

10+ Year Member



I dont want users to be able to open any of my pages in a new window.

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.

encyclo

2:57 pm on Jun 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, superpups!

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.

Bernard Marx

4:40 pm on Jun 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whether you want to worry about JS-disabled browsers is up to you. Many sites do use small pop-ups for legitimate purposes - the better ones having some form of alternative behaviour for non-JS. I largely hate them .. with exceptions.

[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 ]