本人刚学 Html 和 JS 写了下面2个文件 感觉应该显示 Hello world 但实际是什么也不显示,请问我错在哪?
Test.html 内容
Example
script>
myfunc()
script>
Test.js 内容
function Myfunc()
{
document.writeln("Hello world");
}
回复讨论(解决方案)
Example
script>
myfunc();
script>
Test.js 内容
function Myfunc()
{
alert("Hello World!');
document.writeln("Hello world");
}
把两个文件放在同一个文件夹试试. 试了,没什么效果
找到问题了
script> 写成 script> 就好