]> git.mxchange.org Git - mailer.git/blobdiff - js/ajax-loader.js
Local files + modifications and ctracker
[mailer.git] / js / ajax-loader.js
index 7832668c9d6db2da105d7576d4019196b63ef24e..275b5f65f9d0ade451637be76e06d448ec9a12f2 100644 (file)
@@ -1,13 +1,8 @@
-/*
+/**
  * JavaScript for loading more JavaScripts with AJAX
  * --------------------------------------------------------------------
- * $Revision::                                                        $
- * $Date::                                                            $
- * $Tag:: 0.2.1-FINAL                                                 $
- * $Author::                                                          $
- * --------------------------------------------------------------------
  * Copyright (c) 2003 - 2009 by Roland Haeder
- * Copyright (c) 2009 - 2012 by Mailer Developer Team
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team
  * For more information visit: http://mxchange.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -40,14 +35,14 @@ function loadScriptsLocked () {
                $.holdReady(false);
        } else {
                // Recursive call again
-               window.setTimeout('loadScriptsLocked()', 10);
+               window.setTimeout('loadScriptsLocked()', 100);
        }
 }
 
 // Loads more JavaScript resources
 function loadScripts (resources) {
        // Abort here if resources is not defined
-       if (resources == undefined) {
+       if (typeof(resources) === 'undefined') {
                // This is really bad ...
                throw new 'loadScripts() called with no resources (JavaScript files) to load!';
        } // END - if
@@ -61,7 +56,7 @@ function loadScripts (resources) {
        // Begin the loop for all JavaScript files
        for (var i = 0; i < resources.length; i++) {
                // Is the script set?
-               if (resources[i] == undefined) {
+               if (typeof(resources[i]) === 'undefined') {
                        // Array element is missing, which means someone mades a boo boo ...
                        throw new ('resources[' + i + '] not set. Please fix your array.');
                } // END - if
@@ -77,6 +72,9 @@ function loadScripts (resources) {
                        // Count it as loaded
                        resourceCounter++;
                });
+
+               // Wait here a little
+               $('body').delay(100);
        } // END - for
 
        // Wait until all scripts are loaded (asynchronously)