www.webdeveloper.com
Results 1 to 4 of 4

Thread: Newbie question?

Hybrid View

  1. #1
    Join Date
    Oct 2013
    Posts
    2

    Newbie question?

    Hi guys,

    Since today I want to start using javascript, however using tutorials I seem to have some problem immediately.

    I have made some HTML file in notepad++ and named it HTML game. Afterwards I created a JS file named myscript. Within the HTML file I placed this code:

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


    </head>
    <body>

    </body>
    </html>

    Within the JS file just this:
    alert ("Hi there");

    Now when I run the HTML file nothing is shown, when I run the JS file I only see the plain text, nothing is executed. From viewing video's I assumed that this should work. Yes javascript is enabled.. Anyone can help? I placed both files into my wamp server which I just installed. Im running from localhost.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    watch the quote marks
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Sep 2013
    Location
    Houston, Texas.
    Posts
    26
    Just replace this <script src="myscript".js></script> with <script src=myscript.js></script>

    I think it should work

    Reply here if not work properly.

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    Always Quote Attribute Values

    Attribute values should always be enclosed in quotes.

    Double style quotes are the most common, but single style quotes are also allowed.
    http://www.w3schools.com/html/html_attributes.asp
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

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