SBee
07-09-2005, 06:22 PM
Hi-
I am trying to do a detection script - if the user has IE then one .js file loads if it is any other browser, than another .js file loads.
With a little help this is what i have so far and it is not working:
<script type="text/javascript" id="cScript"></script>
<script type="text/javascript">
function loadScript()
{
var conditionalScript = document.getElementById("cScript");
if(getBrowser() == "IE")
conditionalScript.src = "custom.js";
else if(getBrowser() == "otherbrowser")
conditionalScript.src = "customx.js";
}
</script>
help...
Shayna
I am trying to do a detection script - if the user has IE then one .js file loads if it is any other browser, than another .js file loads.
With a little help this is what i have so far and it is not working:
<script type="text/javascript" id="cScript"></script>
<script type="text/javascript">
function loadScript()
{
var conditionalScript = document.getElementById("cScript");
if(getBrowser() == "IE")
conditionalScript.src = "custom.js";
else if(getBrowser() == "otherbrowser")
conditionalScript.src = "customx.js";
}
</script>
help...
Shayna