ppowell777
Coder
I have an HTML file that contains a page that, upon clicking a button, should do the following:
1) A <div> panel opens up
2) That <div> panel contains <script src="scripts/record_update.js"></script>
3) The external .js file "record_update.js" contains only one function: officialRecordUpdate()
4) A dropdown in the <div> panel, upon onChange event, will fire officialRecordUpdate()
However, upon onChange, I am constantly getting "Uncaught ReferenceError: officialRecordUpdate is not defined", which makes no sense, because it absolutely is defined, referenced via <script> tag:
Here is scripts/record_update.js:
Basically, I want to be able to use a function from an external .js file that is only referenced when a particular <div> panel opens up to give you the opportunity to use it, but it seems to no longer be able to load it after page load had previously been completed. How do I successfully load an external script after page load?
Thanks
1) A <div> panel opens up
2) That <div> panel contains <script src="scripts/record_update.js"></script>
3) The external .js file "record_update.js" contains only one function: officialRecordUpdate()
4) A dropdown in the <div> panel, upon onChange event, will fire officialRecordUpdate()
However, upon onChange, I am constantly getting "Uncaught ReferenceError: officialRecordUpdate is not defined", which makes no sense, because it absolutely is defined, referenced via <script> tag:
HTML:
<div id="recordPanel">
<script>
$.getScript("scripts/record_update.js");
</script>
<form>
<select id="yesNo" onChange="officialRecordUpdate()">
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</form>
</div>
Here is scripts/record_update.js:
JavaScript:
function officialRecordUpdate() {
alert('You are in officialRecordUpdate!');
}
Basically, I want to be able to use a function from an external .js file that is only referenced when a particular <div> panel opens up to give you the opportunity to use it, but it seems to no longer be able to load it after page load had previously been completed. How do I successfully load an external script after page load?
Thanks