Basically I want to increment the name of the variable. What is the correct syntax to do this?
for (i=0; i<5; i++) { eval(\"var slider_\" + i);
The right way to do so is to use an object or array. This should work:
var slider = {}; // object // var slider = [] ; // array for (i=0; i<5; i++) { slider[i] = function() { // some code ... } dojo.addOnLoad(slider[i]); }