OK, in PHP you can do something like this:
<?
if (something == 1) {
?>
<table><tr><td><font size="1">Regular HTML goes here </font></td></tr></table>
<?
} else {
?>
<font size="2">More HTML goes here</font>
<? } ?>
Basically, you can break up the PHP code with regular HTML code in between. Can I do the same thing with a javascript IF THEN statement?
I am asking because I use a website system that lets me include HTML templates like this: %%TEMPLATE:mytemplatefile%% which automatically inserts the html stored in the "mytemplatefile.html" file. (Not exactly sure what language this is called but it uses CGI).
I am trying to write a javascript code that says this:
<script type="text/javascript">
if (data=1) {
document.write('%%TEMPLATE:mytemplatefile%%');
}
</script>
But the HTML located in the mytemplatefile.html file is causing javascript problems when it comes through. So, if my original question is not possible, where you could break up the javascript like you can with PHP, then how can I phrase the javascript so that I can include this HTML without the HTML causing javascript errors?