Hello, this may be a basic question. 😉
I am trying to escape some basic HTML that is saved to a variable.
[CODE]
// default HTML text
var i=1;
var t_defaultHTML=”<table width=”100%” border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td>
” + i + “.)
</td>
<td>
<input name=”|_” + i + “-pw_title” value=””>
</td>
<td>
<input name=”|_” + i + “-pw_user” value=””>
</td>
<td>
<span class=”error”>*</span> <input name=”|_” + i + “-pw_pass” value=””>
</td>
</tr>
<tr>
<td colspan=”4″>
<span class=”error”>*</span><textarea name=”|_” + i + “-pw_notes” cols=”60″ rows=”2″>Notes</textarea>
</td>
</tr>
<tr>
<td colspan=”4″>
<div class=”rule”></div>
</td>
</tr>
</table>
“;
The error I get when accessing the function with this code in it is:
[QUOTE]
Error: unterminated string literal
Source File: [url]http://10.0.1.51/~dbrooke/psswd/edcvault.dna?f_page=AddRecord
Line: 118, Column: 18
Source Code:
var t_defaultHTML=”<table width=”100%” border=”0″ cellpadding=”0″ cellspacing=”0″>
What is the best way to encode this kind of text/html?
Thanks,
Donovan