www.webdeveloper.com
Results 1 to 3 of 3

Thread: Newbie question?

Hybrid View

  1. #1
    Join Date
    Oct 2013
    Posts
    2

    Newbie question?

    Guys,

    Just started using JS, some question which turned up immideately:

    I made a HTML file just basic code and used src code to connect with JS file. JS file also contains easy code just to test, however it doesn't seem to work.

    Here the code:
    HTML

    <html>
    <head>
    <script src="myscript".js></script>


    </head>
    <body>

    </body>
    </html>



    JS:
    alert ("Hi there");

    I have installed wamp server. Now when I enter localhost in my chrome I see this files. When I open the HTML file nothing happens. When opening the JS file I don't see anything being executed, I only see the plain text. How is this possible? I have viewed lots of tutorials and also turned on Javascript, so whats the problem? Please help.

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Hey there,

    You just have a typo with the script name:

    Code:
    <html>
     <head>
     <script src="myscript".js></script>
    
    
     </head>
     <body>
    
     </body>
     </html>
    Just move the quote after the .js before the >
    Last edited by bionoid; 10-01-2013 at 05:32 PM.
    JavaScript: Learn | Validate | Compact | bionoid

  3. #3
    Join Date
    Sep 2013
    Location
    Houston, Texas.
    Posts
    26

    Hey Bionoid,

    I think she get the answer, but she didn't reply.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles