QUESTION: What is the best way to trigger a script stored in a fetched file.
BACKGROUND: I send a query string via an HTTPRequest to a file that upon confirmation loads a script containing AJAX calls. I want to know the best way to get the AJAX calls to run when the file in which they are contained is loaded into the file that contains the HTTPRequest.
PROPOSAL: Someone on the internet suggested that the code be placed in an anonymous function that is triggered with the ( ) operator.
//data.js
function() {
code to trigger
}
$.getScript('data.js', function(data) {
();
}
Does this make sense? What would you recommend?
Roddy