Click here to Skip to main content
15,033,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a div

<div id="aux">aqui</div>

XML
linha = "<table cellspacing='0' cellpadding='0' border='0'>";
    linha = linha + "<tr>";
    linha = linha+ "<td>test</td>"; // just testing
    linha = linha + "</tr>";
    linha = linha + "</table>";
    document.getElementById('aux').innerHTML = linha;



But don't work. Looks like in the last line I have some kind of error, because if I put an alert after that line I dont see it (but I see it if I place it before).

EDIT: Ok I know why. I place that code inside a function and that function it's in the first lines of JS. So it's executed before before div is present, that's why dont appear nothing.

Sorry for my English.
Posted
Updated 26-Apr-11 19:34pm
v3

1 solution

Just answering it to pop it out of unanswered list.

resolved by OP himself:
Ok I know why. I place that code inside a function and that function it's in the first lines of JS. So it's executed before before div is present, that's why dont appear nothing.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900