I have the following code in the web app I\'m developing:
var bgcolor = \'\';
var row = 0;
for(var i = 0; i < result.data.length; i++)
{
// Set alternatin
You are calling the function yourself here .click( show_result_dialog(i, result) );
There is a difference between invoking a function show_result_dialog()
and passing its reference show_result_dialog
.
You need to either pass your arguments as event data:
.click( {index: i, result: result}, show_result_dialog );
or simply wrap it in an anonymous function:
.click( function() { return show_result_dialog(i, result) });