I need “i” click functions depending on variable unknown length:
for(i=0;i<=unknownLength;i++)
{$("#group_link_"+i).click(function()
{//asynchronous call to a Web Service for the specific content on group_link_i div, here I will use $("#group_link_"+i).val()}
);}
This code is not working. However, the same code, if i delete the loop and replicate the code above “i” times, it’s working perfectly.
How can I acomplish this functionality using a loop?
Many thanks
A loop isn’t necessary here, just use a better selector like the ‘starts with’ selector