JS to include JS scripts

Hello everyone…

I know I am close here, but I can’t seem to get the last step.

The pages I am working on have a reporting service. What I want to do is this: if the page is on the staging server, then I want it to report to the staging environment. If it is on prod, it can report to the production environment… I have this…

<script type="text/javascript">

if (location.href.indexOf("stage") == -1)
{
    document.write("<script type=\"text/javascript\" src=\"scripts/s_code.js\"></script>");
}
else
{
    document.write("<script type=\"text/javascript\" src=\"scripts/s_code_dev.js\"></script>");
}

</script>

tossing an alert at the top of that area, it doesn’t fire…

Can anyone throw me a bone here? :thumb:

Thnx,

–d