[Javascript] Syntax Error

SoitPP at aol.com SoitPP at aol.com
Fri May 3 08:03:36 CDT 2002


and why does this come out to a syntax error at char 1, line 13.
You aren't allowed to assign eval()'s to variables directly?
Btw, that last one was supposed to be char 17, line 7,

the following produces syntax error char 1, line 13

<html>
<head>
<title>Function Testing</title>
<script language="JavaScript"> 
function removeValue(string) {
        if (string.indexOf("<TEXTAREA")) {
                string = string.substring(0,indexOf("<TEXTAREA")) + 
string.substring(indexOf("</TEXTAREA>",string.length))
                return string
        }
        return string
}
function robot() {
// line 13
preSTRvariable = eval(document.body.innerHTML)
preSTRvariable = removeValue(preSTRvariable)
}
</script>
</head>
<body>
<form>
<button style="background-color: #FFFFFF" onClick="robot()">Click</button>
</form>
</body>
</html>



More information about the Javascript mailing list