Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

euromickey

macrumors newbie
Original poster
Oct 5, 2005
4
0
Since many of my customers send incomplete orders due to a lack af JS abilities in Safari I have added an alert popup which can be tested at http://www.watchband.biz/pub/orderform.htm. I cannot test it since I don't have access to a MAC with Safari on it. So may I ask you folks to have a look?
Thanks.
 

WildCowboy

Administrator/Editor
Staff member
Jan 20, 2005
18,397
2,833
I don't see a pop-up anywhere...the cart seems to work fine for me.
 

euromickey

macrumors newbie
Original poster
Oct 5, 2005
4
0
I have put the following code in the header:

<HTML>
<HEAD>
<script type="text/javascript">
function detectBrowser(){var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)
if ((browser=="Safari"||browser=="Konqueror"||browser=="Microsoft Internet Explorer")
&& (version>=0)) {alert("Your browser environment is not fully supported!")}}
</script>
</HEAD>
<body onload="detectBrowser()">
</body>
</HTML>

The "Microsoft Internet Explorer" detection works on my PC. I just don't get it why the Safari and Konqueror detection does not. I have found the tip at http://www.w3schools.com/js/js_browser.asp
 

dcv

macrumors G3
May 24, 2005
8,021
1
euromickey said:
var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)
if ((browser=="Safari"||browser=="Konqueror"||browser=="Microsoft Internet Explorer")
&& (version>=0)) {alert("Your browser environment is not fully supported!")}}


Stick an alert in your code to test the return value of navigator.appName, or in your case the 'browser' variable... you should find this is actually "Netscape" for the Safari browser, hence your problem.

check out the Safari FAQ

hope this helps!
 

euromickey

macrumors newbie
Original poster
Oct 5, 2005
4
0
I have now updated the navigator.appName to browser=="Netscape".
Can you see the alert now? Will Firefox users see it as well?
 

ITASOR

macrumors 601
Mar 20, 2005
4,398
3
Clicking your link, I get a "Are all product varients blah blah" in Safari running Tiger 10.4.2.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.