showing ... for netscape, show .... for ie

They have: 153 posts

Joined: Jun 1999

I am wondering if there is any script out there that will let me put something like:
< if netscape then show >
12345
< end netscape >
< if internet explorer/other show>
54321

Any help would be greatly appreciated.

AndyB's picture

They have: 344 posts

Joined: Aug 1999

You should be able to work out your own revision to this one:)

<script>

/*Displaying a user's browser type script
By Website Abstration (wsabstract.com)
Over 200+ free scripts here!
*/

if (document.all)
var version=/MSIE \d+.\d+/

if (!document.all)
document.write("You are using "+navigator.appName+" "+navigator.userAgent)
else
document.write("You are using "+navigator.appName+" "+navigator.appVersion.match(version))

</script>

They have: 99 posts

Joined: May 1999

function get_browser_version_one(){
var browserName=navigator.appName;
var browserVer=parseFloat(navigator.appVersion);
if (browserName=="Netscape"){
document.form2.hdnBrowserType.value="N";
}else if(browserName=="Microsoft Internet Explorer"){
document.form2.hdnBrowserType.value="IE";
}else{
document.form2.hdnBrowserType.value="O";
}
}

--Then, when you wish to know what to display, just refer to the hidden field.

You could just as well do a document.write based on the above code.

Regards,

Tazman

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.