I have code that builds a table with javascript API about weather data. However once the table is generated the other plug-ins from HTML javascript files will not interact unless I copy and paste the whole plug-in in that specific file which generates the table.
Please offer suggestions on how to construct a reference to functions in other .js files in a .js file or include the file. I have read some that either sound out of date or unclear how to use the reference. Please do not request my whole code demo since it reveals my API key and will not work without it. Just read the outline of what is going on in these comments.
For example, how to reference these js plug-ins
<!-- Table export plug-in "http://ngiriraj.com/pages/htmltable_export/demo.php" HTML table Export
NOTE try to reference these in the javascript file for building tables instead -->
<script type="text/javascript" src="/Javascript/tableExport.js"></script>
<script type="text/javascript" src="/Javascript/jquery.base64.js"></script>
So reference in:
buildTable.js
{
//One of the above .js scripts to be referenced here...
}
Workflow Outline: Some code generates from API a list of data then configures the data into table elements. The table object will only be modified by code in this .js script, other references from the HTML document will not use the functions unless they are in this file. I have tested this and yes, it is true, code pasted in from other .js files into the buildTable.js file works here to deliver the functions from other .js files but the code is messy to maintain. HTML references will not interact with the run-time generated table since the references occur before the code generates and will exclusively run. Also, making the references in the HTML following the javascript buildTable.js or after the elements does not work (and tested). In a way, these functions need nesting in the execution of the script because they are dependent on modifying an active script for what they do (so a means to reference the other .js files would be a great solution!).