23 lokakuuta, 2014

Part 1 JavaScipt MiniApp HTML5

Miniapp with JavaScript

How to build modern minimum application bare bone, 
with JavaScript in  ECMA 5.1 and in the 'strict mode' ?

First you need minimum HTML 5 page and link to your .js script file:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>StrictModeTestBench, ECMA5.1
    </head>
    <body>
<div id="stage">Hello World Barebone HTML 5
<!-- onerror will reveal if problem is in the file load, or url of the file  -->
        <script src="js/main.js" onerror="alert('Load Err: ' + this.src)"></script>

<!-- If your browser is using cache, use this to force load changes -->
<a href="js/main.js">Load main.js into browser
    </body>
</html>

Usually this is called "index.html", but any name will do if the suffix is right. Use always only plain text. Ok, next let's dive into JavaScript.