script error on require “dijit/form/Select”

♀尐吖头ヾ 提交于 2019-12-13 05:26:10

问题


This code

require([ "dojo","dojo/request/script", "dojo/parser", "dojox/mobile", "dojox/mobile/compat", "dojox/mobile/deviceTheme",
              "dojox/mobile/ScrollableView",
              "dojox/mobile/ScreenSizeAware",
              "dojox/mobile/FixedSplitter",
              "dojox/mobile/ContentPane",


              "dijit/form/Select"
              ],

              function(dojo) {

generate a script error on adding Select. Why? I try this but don't works!

Error: multipleDefine


...on(h){return"[object Array]"==l.call(h)},g=function(h,a){if(h)for(var c=0;c<h.le...

dojo.js (line 2)
Error: scriptError

回答1:


This works for me in WL6 with the default dojo 1.9 library:

function dojoInit() {
require([ "dojo", "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView",
        "dijit/form/Select" ], function(dojo, ready) {
    ready(function() {

        new dijit.form.Select({
            name : "select2",
            options : [ {label : "TN",value : "Tennessee"}, 
                        {label : "VA",value : "Virginia",selected : true}, 
                        {llabel : "WA",value : "Washington"}, 
                        {label : "FL",value : "Florida"}, 
                        {label : "CA",value : "California"} ]
        }).placeAt(dojo.byId(view0));
    });
});
}

There is no error, though the widget display seems messed up in the app. (it works, but doesn't look right) Maybe it needs some css




回答2:


It usually means that you have a different version of dijit/form/Select defined somewhere and their clashing



来源:https://stackoverflow.com/questions/18082652/script-error-on-require-dijit-form-select

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