On Sat, Jun 18, 2011 at 16:07, yakup <[email protected]> wrote:
> I know jquery but it doesn't offer much than the core JS
I'm not entirely sure what you want to do.
If you want to load two scripts dynamically, it's correct that you
can't just add two script elements to the document and expect them to
be loaded in order (like in most other non-WebKit browsers).
You might be able to use the script element's onload event to chain
loading, e.g., something like:
function loadFiles(fileArray) {
var i = 0;
function loadNext() {
if (i < fileArray.length) {
var s = document.createElement("script");
s.src = fileArray[i];
i++;
s.onload = loadNext;
document.body.appendChild(s);
}
}
loadNext();
}
and then
loadFiles(["file1.js","file2.js"]);
(Only tested in current-version browsers)
Best of luck
/L
--
Lasse R.H. Nielsen
[email protected]
'Faith without judgement merely degrades the spirit divine'
Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K -
Denmark - CVR nr. 28 86 69 84
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users