0
我試圖將頁面加載到模態窗口中。我更願意使用它加載必要的js文件,而不是在head
中調用它們,以便爲每個頁面加載它們,包括不需要的頁面。MochaUI不會在窗口中加載腳本src
問題是我無法獲取要加載的腳本。似乎有些東西阻止他們工作。我將evalScripts
設置爲false,並將loadMethod更改爲xhr,因爲文檔說evalScripts選項是xhr的一個選項。注意:在我更改爲xhr和evalScripts之前它沒有工作:false。
這裏是呼叫:
MUI.newthingWindow = function() {
new MUI.Modal({
id: 'newthing',
title: 'New Thing',
contentURL: '/things/newThing/1',
type: 'modal',
loadMethod: 'xhr',
evalScripts: false,
width: 600,
height: 600,
padding: { top: 43, right: 12, bottom: 10, left: 12 },
scrollbars: false
});
};
if ($('newThingLink')) {
$('newThingLink').addEvent('click', function(e){
new Event(e).stop();
MUI.newthingWindow();
});
}
任何線索?
坦克