I have html script:
<html lang="en" >
<head>
<meta charset="utf-8">
<!--<script type="text/javascript" src="included_name_table.js"></script> -->
<script type="text/javascript" src="apps.js"></script>
<script src="name_template.js"></script>
<center><h1>JavaScript Variables</h1></center>
<script type="text/javascript" src="config.js"></script>
<center><p>In this example, x, y, and z are variables</p></center>
<center><p id="demo"></p></center>
<script type="text/javascript" src="demo"></script>
<body onload="initialize('name');">
<script type="text/javascript" src="check.js"></script>
<p> <center> Check for Table </center> </p>
<table height="100px" width="840px" align="center" cellspacing=0 cellpadding=0 border=2>
<tr><td colspan="3"><span id="name_table_body"></span></td></tr>
<br>
</table>
<center> <button style="width:180px;margin-top:5px;margin-bottom:20px;" onClick="submitForm();">Submit Results</button>
</body>
</html>
In the line:
<script type="text/javascript" src="included_name_table.js"></script>
I am trying to set included_name_table.js as a variable which is referenced in a configuration file config.js as table_var as shown below:
var table_var = "included_name_table.js";
The javascript included_name_table.js contains all the information for the table for names.
The reason why I am doing this is so that if I adjust the configuration file I could display another table instead of included_name_table.js. How do I go about having src equal a variable defined in config.js in the line:
<script type="text/javascript" src="included_name_table.js"></script>
?
For additional reference, the file check.js contains the following lines:
var z = port_list_var;
document.getElementById("demo").innerHTML = z;
apps.js contains in the following lines in regards to name_table_body :
document.getElementById("name_table_body").innerHTML = replace_params(included_name_table_var, new Array ("Names"));
included_name_table_var is referenced in the file included_name_table.js as:
var included_name_table_var="<table border=1 cellspacing=0 cellpadding=0 width=100%><tr>" +
"<td width=20% valign='center' align='center' ><#$1$#> :</td>" +
,etc.