Forum Moderators: open
I usually do a fair job with html and css but javascript always whips me! :)
Would oneof you kind souls please take a look at the code below and see if you can straighten it out for me?
I would really appreciate it as I've been starring at it for hours now. IE throws up 2 errors about "unterminated string constant" on certain lines and characters... I've isolated the lines but I can't for the life of me figure out which string is unterminated - they all "appear" to be terminated to me. The erros point to the 2nd and 6th (last) cell. It must be the way I have the popup code? The idea is to have a text link and the cell as active links to a popup window.
Thanks
Rodger
<code follows - it's an excerpt from a table cell>
----------------------------------------------------------
<tr class="tablerow" bgcolor="$altbg1">
<td bgcolor="$altbg2" align="center" width="16%" onClick="location.href='memcp.php'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="memcp.php">$lang_textusercp</a></td>
<td bgcolor="$altbg2" align="center" width="16%" onClick="location.href='a href="#" onclick="Popup('buddy.php', 'Window', 250, 300);'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="#" onclick="Popup('buddy.php', 'Window', 250, 300);">$lang_launchbuddylist</a></td>
<td bgcolor="$altbg2" align="center" width="17%" onClick="location.href='memtool.php?action=lastvisit'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="memtool.php?action=lastvisit">View Posts Since Last Visit</a></td>
<td bgcolor="$altbg2" align="center" width="17%" onClick="location.href='memtool.php?action=userposts'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="memtool.php?action=userposts">View Your Posts</a></td>
<td bgcolor="$altbg2" align="center" width="17%" onClick="location.href='memtool.php?action=unanswered'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="memtool.php?action=unanswered">View Unanswered Posts</a></td>
<td bgcolor="$altbg2" align="center" width="17%" onClick="location.href='a href="#" onclick="Popup('u2u.php','Window', 550, 450);"'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';"><a href="#" onclick="Popup('u2u.php','Window', 550, 450);">$lang_textu2umessenger</a></td>
</tr>
-----------------------------------------------------------
<td bgcolor="$altbg2" align="center" width="17%" onClick="location.href='a href="#" onclick="Popup('u2u.php','Window', 550, 450);"'" style="cursor:hand" onmouseover="this.style.backgroundColor='$altbg1'; "onmouseout="this.style.backgroundColor='$altbg2';">
Secondly, using upper case and lower case correctly is vital. The following are correct: onClick, onMouseOut, onMouseOver. Some of yours are all lower case which is wrong.
Thirdly, you need to be careful with your ' and ". There must be an even number of each sort: when you open them, you must also close them. Remember that you can use ' inside ", and you can use " inside ', but you can't use ' inside ' or " inside ". Yours are a mess, and that is what is causing the error message. Sort them out and you'll be fine.
HTH