matt2kjones
11-02-2009, 10:08 AM
Hey,
I'm have a problem with javascript in internet explorer.
Basically, in any other browser, i can use setatribute to assign the onlick event to occur when the user clicks a row in a table that i have dynamically generated with javascript. However, in internet explorer that doesn't work.
However, using function() {} seems to work, but is causing me a new problem. See the code below:
ResultsTable.rows[RowID].onclick = function() { ShowDocument(RowID); };
Basically, what is happening is, each time i create a new row in the table, i run that above code to assign the onclick event.
But because function() {} creates a pointer to the function, the function doesn't get evaluated each time a row is added.
Basically, RowID, as the parameter for ShowDocument.... is always the ID of the Last Row... not the ID when it was creating the row.
How can i get around this? Any Idea's?
Cheers
I'm have a problem with javascript in internet explorer.
Basically, in any other browser, i can use setatribute to assign the onlick event to occur when the user clicks a row in a table that i have dynamically generated with javascript. However, in internet explorer that doesn't work.
However, using function() {} seems to work, but is causing me a new problem. See the code below:
ResultsTable.rows[RowID].onclick = function() { ShowDocument(RowID); };
Basically, what is happening is, each time i create a new row in the table, i run that above code to assign the onclick event.
But because function() {} creates a pointer to the function, the function doesn't get evaluated each time a row is added.
Basically, RowID, as the parameter for ShowDocument.... is always the ID of the Last Row... not the ID when it was creating the row.
How can i get around this? Any Idea's?
Cheers
