【发布时间】:2011-04-09 23:51:42
【问题描述】:
我将一个函数从一个 html 页面移动到一个包含的参考文件中。它停止工作。
文件的完整内容是:
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>
“包含文件”警报有效,但“功能有效”无效。我做错了什么?
【问题讨论】:
标签: javascript html include alert script-tag