func.js //js文件function Text()
{
alert("hello world");
}function Show(var a, var b)
{
var c;
c = a + b;
return c;
}
index.html <html>
<title>hello world</title>
<head>
<script language = "JavaScript" type = "text/javascript" src = "func.js"><
</script>
</head>
<body>
<script type = "text/javascript">
Text();
var c;
c = Add(1,2);
document.write(c);
</script>
</body>
</html>func.js和index.html在同一个目录下,用firefox调试,提示说Text is not a function,这是什么原因,初学不太懂。
有可能是因为你这里既写了language,又写了type,只要type就够,我只是猜测
{
var c;
c = a + b;
return c;
}
那个Show方法不会是你页面的Add吧?
貌似一个功能的。