Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top