<xp:this.resources> <!-- temporary redefine define.amd object (Dojo AMD loader) --> <xp:script clientSide="true" type="text/javascript"> <xp:this.contents><![CDATA[${javascript:"if (typeof define === 'function' && define.amd) {if(define.amd.vendor =='dojotoolkit.org'){define._amd = define.amd;delete define.amd;}}";}]]></xp:this.contents> </xp:script> <!-- load jquery AMD enabled widgets --> <xp:script src="/select2.js" clientSide="true"></xp:script> <!-- restore define.amd object (Dojo AMD loader) --> <xp:script clientSide="true"> <xp:this.contents><![CDATA[${javascript:"if (typeof define === 'function' && define._amd) {define.amd = define._amd; delete define._amd;}"}]]></xp:this.contents> </xp:script> </xp:this.resources>