WillMaster Possibillites Logo EzineSeek Award
Delayed Exposure Browser Window
by
William Bontrager

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with unsolicited bulk email, provided no fee or other value is exchanged, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

John Payne, in his August 16 issue (issue # 100, by the way!) of Web Marketing Ezine (subscribe at webmarketing-subscribe@itsyourfuture.net ), named me as someone who might write a script to do a specific function.

This article is the result.

Want to make sure every visitor to certain pages also see another specific page? You can.

While your visitor is viewing one of your pages, a separate but hidden browser window loads another page.

Your other page becomes visible when the visitor closes the top browser window.

The example site John referred to loaded an index of products page underneath the current window while the visitor was reading another page about one of the individual products. This ensured that, sooner or later, the visitor would see the complete list of products.

(John's "Tips, Tools, News and Views" section keeps me subscribed. I almost always learn something. Use webmarketing-subscribe@itsyourfuture.net for your own subscription.)

Here is the code. Put it between the <head> and </head> tags of the page the visitor will see first:

<script type="text/javascript" language="JavaScript">
<!-- Copyright 2000 William Bontrager
function MakeBottomWindow() {
// Change URL for the new, bottom window.
var url = 'http://www.domain.com/page.html';
// Width and height of new window (specified in pixels).
var width = '600';
var height = '400';
// Nothing else needs changing.
var p = 'scrollbars=yes,resizable=yes,toolbar=yes,' +
'menubar=yes,status=yes,location=yes,height=' +
height + ',width=' + width;
var botwin = window.open(url,'',p);
self.focus();
}
MakeBottomWindow();
// -->
</script>

Change the URL where indicated. And you may want to adjust the size of the new browser window.

That's all there is to it :)

Oh, if you prefer to load a normal browser window instead of a predefined size, change the line

var botwin = window.open(url,'',p);

to

var botwin = window.open(url);

A demo page is at http://willmaster.com/a/5/pl.pl?57debw

Two words of caution:

  1. Some people are annoyed when gratuitous and unpredicted browsers are launched.

  2. You may wish to implement cookie code so a new browser window isn't launched with every reload. (Umm, a new idea for an article.:-)

There you have it.

Happy, happy!

Copyright 2000 William Bontrager
Programmer/Publisher, "WillMaster Possibilities" ezine
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com
Business Home Page: http://willmaster.com/