HFJS – Book
Review Ch1
Brady Cheng
Roles
 HTML,   CSS, and JavaScript
                                           CSS: coating
HTML: structure




  JavaScript:
    action

                  HTML + CSS + JavaScript = Interaction
Beginning
 Use<script> to tell browser we’re gonna
 use JavaScript
    <script type=“text/javascript”>…</script>
    Better put <script> in the <head> zone
           <html>
            <head>
            <script type=“text/javascript”>
              …
             </script>
            </head>
            <body>
               ….
            </body>
           </html>
Practice - iRock
 Practice   goal
    Create a dead rock
    Say hello to the user when page loaded
    Ask user name
    Touch event of the rock
Practice - iRock
 Without   JavaScript – just a dead rock
Practice - iRock
 Say   hello to the user when page loaded
Practice - iRock
 Make   the rock smile and say hello - prompt
Practice - iRock
 Make   the rock smile and say hello - smile
Review
 Concept
     HTML: bone structure
     CSS: outside coating
     JavaScript: activities
 Practical   stuff
     Prompt
     alert
     onClick event
     Function call

Javascipt ch1

  • 1.
    HFJS – Book ReviewCh1 Brady Cheng
  • 2.
    Roles  HTML, CSS, and JavaScript CSS: coating HTML: structure JavaScript: action HTML + CSS + JavaScript = Interaction
  • 3.
    Beginning  Use<script> totell browser we’re gonna use JavaScript  <script type=“text/javascript”>…</script>  Better put <script> in the <head> zone <html> <head> <script type=“text/javascript”> … </script> </head> <body> …. </body> </html>
  • 4.
    Practice - iRock Practice goal  Create a dead rock  Say hello to the user when page loaded  Ask user name  Touch event of the rock
  • 5.
    Practice - iRock Without JavaScript – just a dead rock
  • 6.
    Practice - iRock Say hello to the user when page loaded
  • 7.
    Practice - iRock Make the rock smile and say hello - prompt
  • 8.
    Practice - iRock Make the rock smile and say hello - smile
  • 9.
    Review  Concept  HTML: bone structure  CSS: outside coating  JavaScript: activities  Practical stuff  Prompt  alert  onClick event  Function call