Home > Features > Surfer Redirection Using JavaScript • Bookmark   • Newsletters   • Register Search Options

FEATURE

Surfer Redirection Using JavaScript

Surfer Redirection Using JavaScript

September 18, 2001
Text size: 
Get XBIZ News
XBIZ Research
Will virtual reality boost the paysite market?
Yes, it will soon
  39.66%
Yes, but in a few years
  36.87%
No
  23.46%
Out of 179 votes. Results based on votes submitted by members of XBIZ.net social network.

" If you build different pages for MS Internet Explorer and Netscape Navigator, you can use this script to send visitors to the correct browser-optimized page. "

Using JavaScript to redirect visitors to your site to pages that are optimized for them has many benefits, and enables you to provide the most enhanced surfing experience possible. Here are a few of the scripts that I employ to make this process possible:

JavaScript Redirect
This code allows you to automatically redirect JavaScript enabled browsers to one page, while displaying a text link and / or message to non-JavaScript enabled browsers. This is especially useful if you (as I do) like to employ "gee-whiz" JS-based nav systems, or even a mundane "drop-down" box navigation, since you can easily filter non-JS users to your pages that use text-link or graphical button "only" based nav system:

<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript Redirect
window.location="http://www.yoursite.com/js_url.html";
// JavaScript Redirect -->
</SCRIPT>
<NOSCRIPT>
Your browser either does not support JavaScript, or you have it disabled. Click <A href="http://www.yoursite.com/no-js_url.html">Here</A> to Continue.
</NOSCRIPT>

Browser Redirect
If you build different pages for MS Internet Explorer and Netscape Navigator, you can use this script to send visitors to the correct browser-optimized page. While I do not personally build entire sites tailored for a specific browser, I will tailor the navigational components of a frames-based site to enable the "happiness" that the use of MSIE allows, for example, sending surfers to either "frameset-ie.shtml" or "frameset-ns.shtml" as the case may be:

<SCRIPT LANGUAGE="JavaScript">
<!-- Browser Redirect
if (navigator.appName.indexOf("Explorer") != -1){
window.location = "http://www.yoursite.com/ie_url.html";}
if (navigator.appName.indexOf("Netscape") != -1){
window.location = "http://www.yoursite.com/ns_url.html";}
// Browser Redirect -->
</SCRIPT>

Screen Resolution Redirect
This lets you redirect your visitors with 640x480 displays to one page, 800x600 to another, etc. Just as I do not (really) build different sites for different browsers, I do not (really) build different sites for different screen resoultions – but I may build sites that will be encapsulated into a new frameset if the user has a high screen resolution. This lets me use better navigation, and provides increased advertising opportunities. Here's the script:

<SCRIPT LANGUAGE="JavaScript">
<!-- Screen Resolution Redirect
if ((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1) || (navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){ size = screen.width + "x" + screen.height; if (size == "640x480"){ top.location = "http://www.yoursite.com/640x480.html"; } }
// Screen Resolution Redirect -->
</SCRIPT>

As you can see, there are many benefits to redirecting surfers to pages tailored specifically for them, and using a few simple JavaScripts – rather than making them select options through a series of text links, is the way to go. Try a few of these out on your site, and stay tuned for more!


OPINIONS & VIEWS

Paysite Meetup: Catching Lightning in a Bottle

We just completed the first XBIZ.net Paysite Meetup in Prague. We caught lightning in a bottle. I first heard that expression from a friend who works in TV. He started in TV in the 1960s selling advertising,... More »

Why a Traffic Network Killed a Popular Offering

Change begets change. Nothing propagates so fast. If a man habituated to a narrow circle of cares and pleasures, out of which he seldom travels, step beyond it, though for never so brief a space, his departure... More »

Luring Cam Users With the Right Ad Format

The live cam marketplace is highly competitive filled with big-, medium- and small-sized players. So how do you stand out from the crowd to attract new users or persuade users to come back and spend their... More »
XBIZ NEWSLETTERS
Stay informed of the latest industry developments. Get XBIZ newsletters delivered to your inbox. Subscribe today!
Enter email address:

* To manage existing subscriptions click here.






POPULAR PRODUCTS & SERVICES
Submit your press release to
multiple news outlets with 1 click.
Subscribe to RSS news feeds or
add free content to your website.
Access XBIZ news and articles
with your mobile device.
Subscribe to XBIZ Premiere magazine, the industry's leading adult retail trade publications, delivering the most timely and comprehensive business news and information to producers and retailers of adult products.

UPCOMING EVENTS

Latin America Adult Business Expo

Jul 10 - Jul 12
Cartagena, Colombia

ANME Founders Show

Jul 16 - Jul 18
Los Angeles Marriott Burbank Airport

QWEBEC Expo

Aug 03 - Aug 06
Montreal, Quebec

XBIZ Berlin 2017

Sep 11 - Sep 14
Berlin, Germany
Everyday thousands of business professionals browse XBIZ's industry directory for quality products and services. Not listed yet? Your company could be losing potential new business. Submit your company today!
Use XBIZ RSS feeds to stay informed of the latest industry developments or as a content syndication tool for your website!