I think the following line is the problem
files = files.concat($.map(src.match(scripts).pop().split(','),
function(e,i){
count = files.length;
// gives me 0 or undefined
Thanks everybody,
to Eric Garside : I have tried "jQuery Automatic Script Includer"
and it does not download scripts for me. Are there any known issues
that I should be aware of?
I placed this code inside of jquery.js right at the end.
(function($){
var scripts = /\?(.*)/, files = [],
The order of elements in a simple array like this is guaranteed.
Looping over an object with a for in loop, the order is not
guaranteed, though by convention most browsers honor the order in
which the elements were added. jQuery would have to go out of its way
to return the elements from your arra
> Can't closure be achieved with for loop?
> for(var i=0; i Does $.each process the "scripts" array items in the exact order they are in
> the
> array?
Yes.
Thanks,
Can't closure be achieved with for loop?
for(var i=0; i
> How can access index i inside of "complete" method?
> The following gives me just the last value of i.
>
> var scripts = ['script1.js', 'script2.js'];
>
> for(var i=0; i
> jQuery.ajax({
>
> dataType: 'script',
> url: scripts[i],
>
I've actually posted code before that does exactly what you're trying
to do. Check out the function here:
http://snipplr.com/view/10368/jquery-automatic-script-includer/
On Jan 27, 7:57 am, Beres Botond wrote:
> That *should* get called twice. What does debug() do?
> If you put alert() instead
That *should* get called twice. What does debug() do?
If you put alert() instead of it, it will still be just 1 alert?
Also If you can test it in Firefox with Firebug addon (http://
getfirebug.com/), you should be able to see if
there are actually 2 requests going out correctly (and the response
t
8 matches
Mail list logo