![]() |
![]() |
|
|
||
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:
There you have it. Happy, happy! Copyright 2000 William Bontrager
| ||