Dojo AMD loader not working in Domino 9.0

戏子无情 提交于 2019-12-25 01:01:57

问题


When I put this on my Form (not XPage):

<script src="/xsp/.ibmxspres/dojoroot/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script> 

calls like this:

require(["dojox/validate/web"], function(validate) {
    validate.isEmailAddress(someAddress);
});

fail with error (this error is from Opera 12.15):

Unhandled Error: Undefined variable: require

I checked with Chrome network panel that dojo.js is loaded and tried also with IE10.

If I use:

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script>

everything works fine. Does Domino have some kind of special version of Dojo 1.8 which does not support AMD loader?


回答1:


I got it to work with the <script> tag syntax shown in Dojo documentation:

<script data-dojo-config="async:1" src="/xsp/.ibmxspres/dojoroot/dojo/dojo.js"></script>

The <script> tag syntax in my question is a copy paste from this Dojo sample. Interestingly it does not work in Domino. Maybe it requires Dojo 1.8.3.



来源:https://stackoverflow.com/questions/16711354/dojo-amd-loader-not-working-in-domino-9-0

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