I am trying to use an ifelse statement to run a <script>. The problem is that when the if statement gets to the </script>, the whole thing dies.
Here is the basic code (trying to keep it as simple as possible):
</script><script language="javascript1.1">
var mlc = document.location.href;
var goodmlc = (mlc.indexOf('C:%5C') > -1);
if (goodmlc == true)
{
<script language="javascript1.1">
}
else
{
</script><script language="javascript1.1" src="http://127.0.0.1/scripts/some.js"></script>
}
The jist of the code is if the URL contains "C:\" then do nothing, otherwise run the <script>.
I have tried a number of variations, all which throw errors. I also thought about throwing this into a function and just calling the function in the ifelse, but I run into the same problem of the </script>. Any help would be greatly appreciated.