Javascript src property doesn't work

html, javascript, src

Solution

You don't need the `<script type="text/javascript">` or `</script>` in your javascript file. In fact, that's what is breaking everything. Remove them and it should work properly.

Problem

It's a very simple one. The source of the webpage is ``` <script type="text/javascript" src="/jscript.js"></script> <html><body> <h1>It works</h1> <p>This is the default web page for this server.</p> <p>The web server software is running but no content has been added, yet.</p> </body></html> ``` I put the js at the very beginning. in jscript.js, it's: ``` <script type="text/javascript"> document.write("test text from bill!"); </script> ``` But it doesn't show the text. If I embed the js into html, it works. And it's strange that when I directly access jscript.js from a webbrowser, the content is like: ``` <script type="text/javascript" src="/jscript.js"> </script><script type="text/javascript"> document.write("test text from bill!"); </script> ``` Can anybody help?

Original source