inherit
105681
0
Apr 30, 2013 13:48:46 GMT -8
Arjun
968
June 2007
adhanjal
|
Post by Arjun on Dec 12, 2009 11:04:46 GMT -8
I want to have an alert page on my website if the visitor is running a browser that is <IE 7, <Firefox 3, <Chrome 2, or it they are viewing from a mobile device. but I also want there to be a link saying, "I understand that my web browser may not be supported, but I would like to continue." How hard would that be to do? www.ramp-it.ca/
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Dec 12, 2009 12:03:31 GMT -8
<html> <head> <div id="good" style="z-index:6;display:none;" class="someclass">Your browser is good. <a href="closePage();">Close</a></div>
<div id="bad" style="z-index:6;display:none;" class="someclass">Your browser is not supported. Please consider upgrading your browser! <a href="closePage();">Close</a></div>
<script type="text/javascript"> function showPage(){ document.getElementById('good').style.display="block"; document.getElementById('good').style.height="101%"; document.getElementById('good').style.width="100%"; document.getElementById('good').style.top = "0px"; document.getElementById('good').style.left = "0px"; }
function showPage_2(){ document.getElementById('bad').style.display=""; }
function closePage(){ document.getElementById('good').style.display="none"; document.getElementById('bad').style.display="none"; } function detectBrowser() { var browser=navigator.appName; var b_version=navigator.appVersion; var version=parseFloat(b_version); if ((browser=="Netscape"||browser=="Microsoft Internet Explorer"||browser=="Google Chrome") && (version>=4)) { showPage(); } else { showPage_2(); } } </script> </head>
<body onload="detectBrowser()"> </body>
</html>
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Dec 12, 2009 14:19:40 GMT -8
You'd need PHP to check the browser via $_SERVER['HTTP_USER_AGENT'] because most mobile devices don't support JavaScript. Plus it would load more quickly that way anyway.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Dec 12, 2009 14:36:11 GMT -8
I didn't include the .mobi stuff.. as you can't accomplish that unless you know what you are doing.. though, the code I posted above does work, I tried it.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Dec 12, 2009 15:43:06 GMT -8
What does .mobi have to do with it? >or if they are viewing from a mobile device You can view any URL from a mobile phone. Not just .mobi URLs. You can't accomplish blocking any browser unless you know what you're doing, which is why he posted here asking for someone who does.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Dec 12, 2009 15:50:35 GMT -8
I meant mobile stuff.. Grumpy Gills.
|
|
inherit
105681
0
Apr 30, 2013 13:48:46 GMT -8
Arjun
968
June 2007
adhanjal
|
Post by Arjun on Dec 12, 2009 20:28:55 GMT -8
You'd need PHP to check the browser via $_SERVER['HTTP_USER_AGENT'] because most mobile devices don't support JavaScript. Plus it would load more quickly that way anyway. I don't know enough about PHP to accomplish that myself. Would you be able to take me through, step-by-step?
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Dec 12, 2009 22:30:44 GMT -8
I don't happen to have a list of what headers each browser sends, so no. It would be a very simple script, if anyone does happen to have access to said headers.
|
|