我编写了一些 JavaScript 代码,运行时会产生以下错误:
"error"
"SyntaxError: Unexpected token ILLEGAL
我不知道这个错误是什么意思。我试着用谷歌搜索它,但找不到任何有用的东西。
这是我的代码:
HTML:
$(document).ready(function(){
$('#fostering').on('click', function(){
$(this).animate({
width : 50px;
});
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<title> Something </title>
</head>
<body>
<div id="fostering"></div>
</body>
</html>
所以,
- 是什么导致了这个错误?
- 我该如何解决?