0

I'm beginning HTML5 development, and I'm already in trouble with javascript in HTML code:

<script>

// javascript code

</script>

If i write my code in HTML only, there's no problem, As soon as I add javascript code, only HTML works but javascript doesn't seem to exist while debugging.

May I link some libraries for JS language? I tryied to create a separate .js file, same problem.

PS. I'm working with Komodo Edit

Thanks for possible solutions.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
Gio31290
  • 89
  • 1
  • 3
  • 8

2 Answers2

3

Take a careful look at this minimal example and compare with your own code...

<!DOCTYPE html>
<html>
    <head>
        <title>test</title>
        <script type="text/javascript">
            alert("this works");
        </script>
    </head>
    <body>
    </body>
</html>
spender
  • 117,338
  • 33
  • 229
  • 351
  • The code syntax is perfect, and it works if I print some words, or an alert message,the problem is about functions and methods(for loops, creating canvas, etc.). In a few words, I can't execute the code as a web application. Maybe, as a beginner developer, I'm not using javascript the right way – Gio31290 Sep 07 '14 at 16:46
0

Ensure your browser is allowing popups, and the java script....But you would have to post more of what your trying to do, so we could ensure your code is correct as well....

Jeremy
  • 84
  • 8