summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/js/js.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 370e68f5602..8c1a2e157d0 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -366,15 +366,20 @@ var OCP = {},
*/
addScript:function(app,script,ready){
var deferred, path=OC.filePath(app,'js',script+'.js');
- if(!OC.addScript.loaded[path]){
- if(ready){
- deferred=$.getScript(path,ready);
- }else{
- deferred=$.getScript(path);
- }
- OC.addScript.loaded[path]=deferred;
- }else{
- if(ready){
+ if(!OC.addScript.loaded[path]) {
+ deferred = jQuery.ajax({
+ url: path,
+ cache: true,
+ success: function (content) {
+ eval(content);
+ if(ready) {
+ ready();
+ }
+ }
+ });
+ OC.addScript.loaded[path] = deferred;
+ } else {
+ if (ready) {
ready();
}
}