That was only 1 example, and a pretty basic one at that thinking about it. This happens literally hundreds of times throughout the site for various different reasons.
Here's another example (a better one):
<SCRIPT language="javascript" type="text/javascript">
if ((screen.width == 1024) && (screen.height == 768))
document.write("<td valign='top' height='560'>");
else document.write("<td valign='top'>");
</SCRIPT>
And another example:
<SCRIPT type="text/javascript" language="javascript">
if ((screen.width == 1024) && (screen.height == 768))
document.write("<table width=180 border=0 cellspacing=2 cellpadding=1>");
else document.write("<table width=155 border=0 cellspacing=0 cellpadding=0>");
</SCRIPT>
So in this last example, a validation error will occur because there will be a </TABLE> tag later on which won't be correct as it doesn't recognise that <TABLE> tag occurs earlier in the document.
Hope that makes my problem clearer. Thanks for your suggestion.
Cheers
SWD
Main Topics
Browse All Topics





by: jmanGJHS97Posted on 2007-03-29 at 07:39:08ID: 18816482
What happens when you alert screen.width? An alternative is to put the TR in question inside the script that creates the table. I can't think of any reason why you would want to write out the TR and not the TABLE, so put the two together.