0
加載js.aspx文件我正在使用Microsoft Dynamics CRM,它有一個名爲ClientGlobalContext.js.aspx
的文件來提供Xrm對象,並且還有很多自定義腳本。有些文件正在使用XRM對象從ClientGlobalContext.js.aspx.
如何使用REQUIRE.JS
現在我要管理使用require.js我所有的JavaScript文件,但如何使用require.js加載ClientGlobalContext.js.aspx?
這裏是我想要
requirejs.config({
//By default load any module IDs from js
baseUrl: '',
//here we set our js folder
//config is relative to the baseUrl, and
//never includes a ".js" extension since
//the paths config could be for a directory..
paths: {
'jquery':'//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min',//set jQuery path you can also include your folder js
'jqueryui':'//ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min',// set jQuery ui path you can also include your folder js
'SDK.JQuery':"sample_/Scripts/SDK.JQuery",
'json2':"sample_/Scripts/json2",
'new_connexx':"new_connexx",
// 'new_common':"new_common",
'new_moment':"new_moment.min",
'new_controls':"new_controls",
'ClientGlobalContext': 'ClientGlobalContext.js.aspx'
},
shim: {
'new_controls': {
deps: ['new_moment','new_connexx'],// here we are defining that it depends on jQuery
},
'new_connexx':{
deps:['jqueryui']
},
'jqueryui':{
deps:['jquery','json2','SDK.JQuery']
},
'SDK.JQuery':{
deps:['ClientGlobalContext']
},
'new_moment':{
deps:['jqueryui']
},
'new_common':{
deps:['jqueryui']
},
'new_letter_wizard':{
deps:['jqueryui']
}
},
});
請建議,如果有一些事情我失蹤
它是如何失效的?您收到錯誤訊息?有一些你期望的效果不會發生?請在你的問題中指定它。 – Louis