From 68aaa49c94c9dc60ef8a1d06625ca24c0e3e8b89 Mon Sep 17 00:00:00 2001 From: wangjeaf Date: Wed, 18 Jun 2014 18:01:02 +0800 Subject: [PATCH 1/2] delete seajs jquery cache --- WebContent/stat/js/util/mock.plugin.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/WebContent/stat/js/util/mock.plugin.js b/WebContent/stat/js/util/mock.plugin.js index a50d8ad..2df2b3e 100644 --- a/WebContent/stat/js/util/mock.plugin.js +++ b/WebContent/stat/js/util/mock.plugin.js @@ -226,7 +226,16 @@ } } - if (window.define && window.define.cmd) { + if (window.seajs && window.define && window.define.cmd) { + // 删除已经加载的jquery缓存 + var cache = seajs.cache; + for(var prop in cache) { + prop = prop.toLowerCase(); + if (prop.indexOf('jquery') != -1) { + delete cache[prop]; + } + } + var data = seajs.config().data; data.alias = data.alias || {}; var path = 'http://' + ROOT + '/stat/js/util/jquery-rapped.js'; From 45c6754a7519e86d0a9d9bbb6e89e9f5b6c87b07 Mon Sep 17 00:00:00 2001 From: wangjeaf Date: Wed, 18 Jun 2014 18:03:09 +0800 Subject: [PATCH 2/2] cache || {} --- WebContent/stat/js/util/mock.plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/stat/js/util/mock.plugin.js b/WebContent/stat/js/util/mock.plugin.js index 2df2b3e..6e7b31c 100644 --- a/WebContent/stat/js/util/mock.plugin.js +++ b/WebContent/stat/js/util/mock.plugin.js @@ -228,7 +228,7 @@ if (window.seajs && window.define && window.define.cmd) { // 删除已经加载的jquery缓存 - var cache = seajs.cache; + var cache = seajs.cache || {}; for(var prop in cache) { prop = prop.toLowerCase(); if (prop.indexOf('jquery') != -1) {