www.uburst.com www.uburst.com

"Javascript"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

General Questions
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Javascript"
Posted by Ron Harter on Jul-06-03 at 10:24 PM (EST)
I found something interesting on the Amazon web site and wonder if it is something I should use.
I am not a programmer but it looks like it may be checking to see which browser the customer is using. I don't know how much will show up in this forum but I will give it a try:

script language="JavaScript1.1" type="text/javascript"
!--
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_aol = (agt.indexOf("aol") != -1);
var is_opera = (agt.indexOf("opera") != -1);
var is_win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
//-->
/script

I also noticed they specify javascript1.1 rather than just javascript.
Maybe you can shed some light on this.
Thanks
Ron

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Javascript, Bill Weiner, Jul-08-03, (1)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Javascript"
Posted by Bill Weiner on Jul-08-03 at 06:42 AM (EST)
Yes, it looks like the JavaScript is just trying to determine the browser type. They must have other JavaScripts on their page that need to know the browser type ... probably for formatting reasons.

And as for the specification of JavaScript 1.1 instead of just JavaScript, that is just to ensure that JavaScript 1.1 is used since that is the syntax/functions used in their script. Without that specification, the browser would just use it's default... which may/may not be JavaScript 1.1.

With uShop's Java Applets and JavaScripts, there is no reason why you would need to use such a JavaScript.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.