PhoneGap / Cordova 1.6 and dojo 1.7.2 AMD works from web, not from local?

佐手、 提交于 2019-12-13 01:13:48

问题


I have recently upgraded my PhoneGap/dojo1.6 app to cordova 1.6 and everything works just fine.

Then I upgraded to dojo 1.7.2 using hosted dojo: [script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" data-dojo-config="async: true"][/script]

And again, everything works fine.

But when I tried to use local dojo, much like I did when using dojo1.6 and cordova1.6, the dojo.js is found and loaded, but the app won't start/load other dojo module files.

[script src="dojo1.7.2/dojo/dojo.js" data-dojo-config="async: true"][/script]

I ended copying the entire dojo1.7.2 (didn't build anything), but still the app won't load and I get no error messages in the console.

Does anyone have any idea what might be the problem?

Thanks in advance, Guy


回答1:


Try using the following config in your dojo [script src=]:

data-dojo-config="async:false,parseOnLoad:true"

Also include the cordova.js file BEFORE the dojo.js file.



来源:https://stackoverflow.com/questions/10209558/phonegap-cordova-1-6-and-dojo-1-7-2-amd-works-from-web-not-from-local

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!