Why can't I roll a loop in Javascript? -


I am working on a web page that uses dojo and I have a number (my trial cases In 6, but in general variables) I'm calling dojo.addOnLoad (init) of the project widget, and my init () function has these lines:

  dojo.connect (Dijit.byId ("project" + 0). InputNode, "On Change", function () {makeMatch (0);}); Dojo.connect (dijit.byId ("Project" + 1). Input node, "On Change", function () {makeMatch (1);}); Dojo.connect (dijit.byId ("Project" + 2). Input node, "On Change", function () {makeMatch (2);}); Dojo.connect (dijit.byId ("Project" + 3). Input node, "On Change", function () {makeMatch (3);}); Dojo.connect (dijit.byId ("Project" + 4). Input Node, "On Change", Function () {makeMatch (4);}); Dojo.connect (dijit.byId ("project" + 5). Input node, "onchange", function () {makeMatch (5);});  

And changing the events for my project widget correctly calls the MakeMake function. But if I change them with a loop:

 for  (var i = 0; i  

The same makeme () function, the same init () invitation, the same thing - rolling my call in just one loop - the makemail function is never called; The objects are not wired.

What's going on, and how do I fix it? I tried to use dojo.query, but its behavior is similar to the loop case.

This is a common problem when working with the closing:

) ({i , Function () {MakeMatch (I);});} (I)); }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -