On 2/17/12 10:35 AM, Fibo wrote:
The title is slightly obscure, so here is a more detailed description
of my problem.

1 - I have a main page (say A)  which of course loads the css and js
needed for it.

2 - I make a href to an external file (say B). In this file B is some
html code AND javascript code working on this (B) html code. So I
cannot load and run the javascript directly from A, since html
elements from B are not visible when A is first loaded.

I'm certainly not the first doing that, so I presume there is some
working example somewhere...
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.html
It 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

--
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to