Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE/Netscape - How do you determine which?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there a way to tell the difference to if the user is running on netscape or IE? I would think javascript would do the job, but I'm not sure how to script that. Also, is it possible to determine what operating system the user is running? I have a jsp page, and I want the font/size to change accordingly to what the user is using.

Thanks, any info would be greatly appreciated-

Javaboy
 
you need to search for a browser redirect script if you wish to send users to a specific browser based on the system they are using.

It would be a javascript and might be located at javashareware.com or you could just run a search on a search engine.
 
or you could also go to the jscript forum .. perform a search using "redirect" or "browser detection" as a keyword ... and you'll get your code :)
 
Browser redirect script:

<script>

var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 4+
if (browser_type==&quot;Netscape&quot;&amp;&amp;browser_version>=4)
window.location.replace(&quot; website here/netscape.htm&quot;)
//if IE 4+
else if (browser_type==&quot;Microsoft Internet Explorer&quot;&amp;&amp;browser_version>=4)
window.location.replace(&quot; website here/ie.htm&quot;)
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location=&quot;your website here/netscape.htm&quot;
</script>

Replace &quot;your website here&quot; with the actual URL. Cheers,
Jim
reboot@pcmech.com
Moderator at Staff at Windows 9x/ME instructor.
Jim's Modems:
 
Where did javaboy mention redirection?

Anyway - all this information is contained in the 'navigator' object. Check it out in your documentation, or at at their developer center, you'll find all that.

The thing about it is though, that you may have trouble setting one attribute to filter down especially in Netscape 4 where you often need to redefine classes and styles locally throughout the page - but the theory is sound.

A full replace may be necessary, but I agree it shouldn't and,depending on your page you may not have to, just make sure to test it in Netscape. &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top