twitter bootstrap - XPages and Loading JavaScript Files -
i using xpages bootstrap 3 , asking earlier how formvalidation.io working. able brahim arkni , hinged on fact javascript file wasn't loaded.
i'm trying use intltelinput , receiving same kind of message "intltelinput not function" i'm working on theory same problem. files loaded perhaps not in correct order or @ correct time.
so question is, when call .js file within theme file (it loads displays .js files in 1 long line less easy search find if correct file loaded) using syntax:
<resource> <content-type>application/x-javascript</content-type> <href>formvalidation/dist/js/formvalidation.js</href> </resource>
or when load files inside of custom control or xpage (which show on separate lines when looking see ones loaded), using:
<script src="build/js/intltelinput.js"></script>
i should add of these files in webcontent folder in application.
is there 'right' way load javascript files , how know order load them in?
08/15/2017: per. commented out part in file , code above changed to. how have gone wrong, because still same error message, along "unexpected token" function per. commented out part in file , code above changed to. how have gone wrong, because still same error message, along "unexpected token" function a
! function(a){ if(typeof module && module.exports){ "object" == module.exports=a(require("jquery"), window, document; return "object"; } else { "function" == define(["jquery"], function(b) { a(b, window, document) }); return "function"; } } //! function(a) { // "function" == typeof define&&define.amd? define(["jquery"], function(b) { // a(b, window, document) // }) : "object" == typeof module && module.exports ? module.exports = a(require("jquery"), window, document) : a(jquery, window, document) //}
the jquery plugin intl-tel-input uses amd conflicts dojo in xpages. see this answer solution on how disable amd in order make plugin work.
in case should change first part of intltelinput.min.js following (where have replaced define.amd false):
!function(a){"function"==typeof define&&false?define(["jquery"],function(b){a(b,window,document)}): ...
Comments
Post a Comment