0

I'm writing a short script that loops through an array and loads each of the results found although I'm having some issues with it loading. If I alert my results found in each loop I get the right data but when I attempt to load this data, it fails.

var arrayScripts = new Array (
        'http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', 
        'scripts/tiny_mce/tiny_mce.js',
        'scripts/jquery.cycle.lite.js',
        'scripts/javascript.default.js',
        'scripts/jquery.default.js'
    );

    for (var i=0; i < arrayScripts.length; i++) {
        scripts.add(arrayScripts[i]);
    }
    scripts.load();

I hope you can see what I'm doing wrong here. It appears to be my code inside of my loop.

3
  • 1
    Can I suggest a framework, like RequireJS? requirejs.org Commented Apr 5, 2013 at 17:08
  • Maybe this is what your looking for? stackoverflow.com/questions/8278492/… is-needed Commented Apr 5, 2013 at 18:07
  • Hi guys and thanks for a reply. I'm simply running a loop that loads my JavaScript files. Therefor upon load of my page, it will continue with the rest of the code whilst my JavaScript files are loaded asynchronously Commented Apr 5, 2013 at 21:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.