我想把它放在我的网站上
<script type="text/javascript"> <!-- window.onload = hello; function
hello() { var name = prompt("What is your name", "") alert ( "Hello "
+ name + "! Welcome to my forum.") } </script>
Run Code Online (Sandbox Code Playgroud)
但我不想把它放在索引中但是在单独的文件中,让我们说hello.js
如何从索引文件中调用它,所以当我单击index.html时,它会立即提示我的名字.(例如)
我说<script src="hello.js"></script>不行.