diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-10-09 09:04:42 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-14 20:45:36 +0200 |
commit | 365f68372f7d1e773ede9e428535e52406835212 (patch) | |
tree | 057bc06c1e820680c19a842676f2554cf1255834 | |
parent | 5b61ef9213df0ff67ebd5b9c88a8e1562f367351 (diff) | |
download | nextcloud-server-365f68372f7d1e773ede9e428535e52406835212.tar.gz nextcloud-server-365f68372f7d1e773ede9e428535e52406835212.zip |
Use jQuery.getScript to dynamically load script
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | core/js/js.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js index d78b0159cfa..12c47d546c1 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -368,15 +368,9 @@ var OCP = {}, addScript:function(app,script,ready){ var deferred, path=OC.filePath(app,'js',script+'.js'); if(!OC.addScript.loaded[path]) { - deferred = jQuery.ajax({ - url: path, - cache: true, - success: function (content) { - window.eval(content); - if(ready) { - ready(); - } - } + deferred = $.Deferred(); + $.getScript(path, function() { + deferred.resolve(); }); OC.addScript.loaded[path] = deferred; } else { |