我遇到了一个意外错误,我在调试时遇到了一些烦人的问题。我得到的错误是这样的:
Uncaught SyntaxError: Unexpected token }
这是 HTML:
<html>
<head>
<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<form class="search" action="search" method="get">
<input type="text" id="search-string" />
<button type="button" onclick="return clearInputValue( $("#search-string") )">
<span class="clear-icon"></span>
</button>
</form>
<script>
var clearInputValue = function(a) {
// Ultimately I will check if the object passed to this function has a value greater than 1, and if so, I will clear the input
return false;
};
</script>
</body>
</html>