infoTemplate=new esri.InfoTemplate("<div align='center'><input type='button' value='Use this location' onclick='test(x,y,z)'></div>");
I have defined x,y,z as:
x=5;
y=10;
z="Sairam";
I am getting an error on my browser as " 'Sairam' is undefined". When I pass only numeric values, it works fine. But if i pass a String, i get this undefined error. Could some one tell me how i could pass a String as a parameter on this info template button onclick function?
The error persists even if I put it inside quotes. I did a workaround to make it work. I globally declared a Javascript Array, stored the string in it and passed the index of the array through the info template. With that index, I can access my content from the array.