这是一个基本的东西,我无法弄清楚.考虑以下:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.js" />
<script language="JavaScript" type="text/javascript">
function Show(msg){
alert(msg);
}
</script>
</head>
<body>
<input type="button" onClick="Show('hello');" value="Show 1" />
</body>
</html>Run Code Online (Sandbox Code Playgroud)
如果我排除"jquery"include,上面的示例工作正常.我在这里错过了什么?
这是因为自闭脚本标签不起作用.使用:
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.js"></script>
Run Code Online (Sandbox Code Playgroud)