I want to post this on my website
<script type="text/javascript"> <!-- window.onload = hello; function
hello() { var name = prompt("What is your name", "") alert ( "Hello "
+ name + "! Welcome to my forum.") } </script>
but I do not want to put it in the index, but in a separate file, say hello.js
How can I call it from an index file, so when I click on index.html it immediately asks for my name. (eg)
I put it <script src="hello.js"></script>does not work.
source
share