I am getting a javascript error below, but I can’t seem to find the problem:
*Message: Expected ‘)’
Line: 431
Char: 220
Code: 0
URI: http://mywebsite/CustomerLogin.aspx*
Line 431 is this javascript line:
<script language='Javascript'>
var varDateNow = new Date();
var varTimeNow = varDateNow.getTime();
var varAlertTime = document.getElementById('cphTopContent_AlertTime').value;
if(varTimeNow - varAlertTime < 1500)
{alert('2' values you entered were not valid:\n\nLog In - This value requires at least 6 characters. \nPassword - This value requires at least 4 characters. \n');}
</script>
What is causing the javascript error?
You have a missing open quote. Try taking out the close quote after the
2in the alert.Here’s what happened behind the scenes: Since you closed the quotes after the 2, you’re actually opening a new set of quotes at the end of the line after the
\n. So the compiler interprets everything following that point as a string, and thus it never finds the closing parenthesis.