|
Q12 How can I get script embedded in a table to work?
irt.org | Knowledge Base | JavaScript | Table | Q12 [ previous next ]
Q12 How can I get script embedded in a table to work?
The following HTML will not work on all browsers:
<table border=1>
<tr>
<td>
<script language="JavaScript"><!--
document.write("JavaScript Text which may or may not be output");
//--></script>
</td>
<td>
<script language="JavaScript"><!--
document.write("JavaScript Text which may or may not be output");
//--></script>
</td>
</tr>
</table>
|
Whereas the following code will work on all:
<script language="JavaScript"><!--
document.write("<table border=1>");
document.write("<tr>");
document.write("<td>");
document.write("JavaScript Text which may or may not be output");
document.write("<\/td>");
document.write("<td>");
document.write("JavaScript Text which may or may not be output");
document.write("<\/td>");
document.write("<\/tr>");
document.write("<\/table>");
//--></script>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.