I am very new to web development and under major deadline. I would really appreciate your help on this.
I have an array which gets created through a javascript function which runs when user clicks on a particular table on the webpage.
<tr id="table1_1_1_0">
<td><a href="#" onclick="func_get_fields('table1_1_1_0');">Primary</a></td>
</tr>
This function func_get_fields creates an array List_of_Screen_Names which has entries to be displayed.
My question is how do I display the elements of this returned array in the webpage so that each of them is a link in itself.
I found some code which works with the php arrays but not with javascript.
How can i do this ?
I tried another approach
document.write('<table border="1" cellspacing="1" cellpadding="5">')
for(i = 0; i < List_of_Screen_Names.length; i++){
document.write('<tr><td>');
document.write(List_of_Screen_Names[i]);
document.write('</td></tr>');
}
document.write('</table>');
This creates a table of strings which I think can be changed to links. But it completely wipes off the webpage and shows only the table. How to make it display within a div.