In the below code I have "mainTable" which is the name of an object I am using in my code. This code as it is, works fine. But.....
cell.innerHTML = '<a href="#" onclick="eval(\'fillNewCol(mainTable,1)\')">Add More +</a>';
If I change it to this obj.tablename, I am getting errors. It as if obj.tablename itself is being passed instead of its string value.
obj.tablename = mainTable;
cell.innerHTML = '<a href="#" onclick="eval(\'fillNewCol('+obj.tablename+',1)\')">Add More +</a>';
cell.innerHTML = '<a href="#" onclick="eval(\'fillNewCol(mainTable,1)\')">Add More +</a>';
If I change it to this obj.tablename, I am getting errors. It as if obj.tablename itself is being passed instead of its string value.
obj.tablename = mainTable;
cell.innerHTML = '<a href="#" onclick="eval(\'fillNewCol('+obj.tablename+',1)\')">Add More +</a>';