Please help me correct this.
I used template table with inline event handler.
e.g.
// assume that this will create table rows showing Name from someArray
// someArray is global array list
for(var =i; i<someArray.length; i++){
var obj = someArray[i];
<td> <span onclick="showRelatedObj(i)">obj.Name</span> </td>
}
//----------------------
function showRelatedObj(p){
var obj = someArray[p];
showMessageBox(obj.Name +" ," + obj.Location.....);
}
===================================================================
When I read some design guide,
html content should be separate with content with events,
in that way, it is easier to modify as well as easier to search by Search Engine.
If I use separate event handlers instead of inline one, it will be complex by using id and searching with loop, isn’t it?
Please kindly suggest alternate or standards way to accomplish this.
for example with jQuery:
you can calculate i value from ‘this’ variable, that mean the clicked span element