iUI does not have this functionality built-in. However, there is an
extension called jit-loader.js (in the extensions sandbox) that will
load JavaScript along with an Ajax HTML fragment. There is a sample
app, too. You can view it here:
http://demo.iui-js.org/iui/ext-sandbox/jit-loader/test-jit-loader.htmlIt looks like the Google Maps functionality in the demo is broken, so
look at the "Test JavaScript Load -> Sub1" and " -> Sub2" pages.
Your other option is to have all your JavaScript loaded with "A", but
modify the JavaScript so that it can detect when "B" is loaded. (You
could use the iUI extension mechanism to do this)
Make sure you are using the latest version of iUI -- 0.40-beta2
-- Sean