我将函数从html页面移动到了包含的参考文件。它停止工作。将JavaScript函数移动到外部.js文件时停止工作
文件的完整内容是:
alert('file included');
function doAlert() {
alert('functions work');
}
在HTML页面中,我有
<html>
<head><title>Page</title></head>
<body>
HTML Template Header
Some Content
ASP.NET MVC Partial View Starts
<script type="text/javascript">
doAlert();
</script>
ASP.NET MVC Partial View ends
HTML Template Footer
<script type="text/javascript" src="/Scripts/wtf.js"></script>
</body>
</html>
“文件包括”警报的作品,但“职能的工作”没有。我究竟做错了什么?
啊,这显然是我必须做的不对 – smartcaveman 2011-04-09 23:59:04