Dojo on (events) firing on declaration -


while using new dojo event (on) i'm getting lot of loops.

i'm calling first time doshowsomedialog(null).

why function loop? (dialog has been declared before dijit/dialog)

doshowsomedialog = function ( value ) {  var selectname = 'selector';  if ( value ) {      dialog.set("href", "/url/"+ selectname +"/"+ value );  } else {      dialog.set("href", "/url");             dialog.show(); }  dialog.set("ondownloadend", function() {      on( dijit.byid(selectname ), "change", doshowsomedialog( dijit.byid( selectname ).get('value')  ) );   }); }     

it seems "on" executes on declaration of event.

this execute method when calling on. should wrap in it's own function.

doshowsomedialog( dijit.byid( selectname ).get('value') 

should become

function() { doshowsomedialog( dijit.byid( selectname ).get('value'); } 

Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -