undefined - dojo aspect not defined, dont understand why -


i want update dojo 1.7 1.8.3 have replace dojo.connect command.

switch:

< div id="universalpushswitch" data-dojo-type="dojox.mobile.switch" style="float:right" class="mblswroundshape1"></div> 

now have:

dojo.require("dijit/registry"); dojo.require("dojo/ready"); dojo.require("dojox/mobile/listitem"); dojo.require("dojo/aspect");  dojo.ready(function(){   dojo.aspect.after(dijit.registry.byid("universalpushswitch"), "onstatechanged",          function(newstate){         alert(newstate);     } )}); 

firebug says: "aspect not defined"

ps: know don't use new amd loader. old project , new dojo stuff. simple translate dojo.require("x");dojo.require("y"); require(["x","y"], function (x,y){...} doesn't work me there still old style require.

try using:

dojo.aspect.after(...); 

instead of

aspect.after(...); 

and not stop @ next function ! :-)

if doesn't work @ once, try loading aspect global way (with dot, not slash):

dojo.require("dojo.aspect"); 

it possible, old dojo not compatible "/" , works dots !

source:

http://livedocs.dojotoolkit.org/dojo/require

edit:

here working fiddle based on fiddle:

http://jsfiddle.net/9xdv2/

the main problem code did not parse html. dojo parser converts specific html "dojo javascript objects" ! use kind of html lot ! should have done a:

dojox.mobile.parser.parse(); 

everything in jsfiddle !

lucian


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -