Identical functions in multiple loaded scripts - choosing which version is called
Posted on 2006-03-29
I've got a single page for editing various sets of data; the user chooses which set to work with from a menu, and the page loads the list of stuff & textboxes, etc, into a container div on that page via xmlhttp. There is one universal "save" button that simply calls "save()".
So basically my question is, how can I reload or reposition scripts in such a way that an already-loaded script's function becomes the "last defined" version of that function?
Here's a pseudocode example:
if(document.scripts[filename]) return, else document.scripts += new script(filename)
since each module has its own "save" function, this happens
onMenuChange(moduleA) // calls the "Save" function from moduleB.js