我的 HTML 文件:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" />
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<form name="someForm">
<input type="button" value="Click me" onClick="myFunction()" />
</form>
<div id="result"></div>
</body>
</html>
我的 script.js 文件:
function myFunction(){
$("#result").html("BUTTON WORKS");
}
我有 Firebug,每当我单击按钮时,Firebug 都会向我抛出此错误:
ReferenceError: myFunction 未定义
我究竟做错了什么?