External Javascript Document Not Working in HTML

Unless I put the code in the script tag, the actual javascript would never show. Could someone tell me why?

Comments

  • Unless you show what you're doing we can't help you much.
    Here's a simple example that works:
    hello.html

    <html>
    <head>
    <title>test</title>
    <script src="hello.js"></script>
    </head>
    </html>
    

    hello.js

    document.write('hello');
    document.write(' world');
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion