simon551
IS-IT--Management
- May 4, 2005
- 249
Hi. I'm working on an intranet site so I have the luxury to be lazy and not test in IE. We have a corporate policy to only use firefox. But I have found that people use it anyway out of old habits. Instead of testing in IE, to save time (single programmer not all that skilled) I'd like to just put in a script in my first included file that test for browser and if not firefox or safari then die.
Second part about being a fairly limited programmer (actually I'm an accountant who does some programming but I digress): I can't figure this out. I tried modify some basic AJAX browser testing to just determine if this is not firefox/safari/opera but it's not working. Can you check what I'm doing?
Thanks!
Second part about being a fairly limited programmer (actually I'm an accountant who does some programming but I digress): I can't figure this out. I tried modify some basic AJAX browser testing to just determine if this is not firefox/safari/opera but it's not working. Can you check what I'm doing?
Code:
<script type="text/javascript">
function browserCheck()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
alert("Do not use IE, sorry!");
}
}
window.onload=browserCheck;
</script>