PDA

View Full Version : Different page for different browser (IE or NS)


lillehop
03-09-2003, 02:49 PM
How to open different page using My Pocket PC with Pocket IE. The script on this site is showing exemples for Netscape and Explorer. Where can I find the code fore Pocket PC?


Please help me somebody?!

<script>
<!--
/*By George Chiang (JK's JavaScript tutorial)
http://www.javascriptkit.com
Credit must stay intact for use*/
var n=navigator.appName
var ns=(n=="Netscape")
var ie=(n=="Microsoft Internet Explorer")
if (ns)
location="page1.htm"
else if (ie)
location="page2.htm"
//-->
</script>

timur
03-10-2003, 09:03 AM
Try to disclose te solution by yourself

Try this page under your poket PC

<html>
<head>
<title></title>
<script>

onload = function(){
document.write(navigator.appName);
}

</script>
</head>
</html>

You will see the string that identifies your poket PC

Then you can modify George Chiang's script:

<script>
<!--
/*By George Chiang (JK's JavaScript tutorial)
http://www.javascriptkit.com
Credit must stay intact for use*/
var n=navigator.appName
var ns=(n=="Netscape")
var ie=(n=="Microsoft Internet Explorer")
var poketPC=(n=="Replace with you string")
if (poketPC)
location="page1.htm"
else if (ie)
location="page2.htm"
else if (ie)
location="page3.htm"
//-->
</script>