SlideShare a Scribd company logo
1 of 74
“
    ”
JavaScript
JS   …
Web
browser           Server




          (^o^)
Web
browser   Server
…
browser       Server
browser   Server
1


browser           Server




              …
browser   Server
HTML
Web
GET index.html


browser                    Server




            <html>
           … Hello …
            </html>
<html>
 <head>
  <link rel="stylesheet" href="style.css" />
 </head>
 <body>
  <img src="hello.png" alt="Hello" />
  <img src="world.png" alt="World" />
  <script src="script.js"></script>
 </body>
</html>
<html>
 <head>
  <link rel="stylesheet" href="style.css" />
 </head>
 <body>
  <img src="hello.png" alt="Hello" />
  <img src="world.png" alt="World" />
  <script src="script.js"></script>
 </body>
</html>
HTML
CSS
<link rel="stylesheet" href="style.css" />


                           …
browser                                  Server




                  body {
                color: red;
                    }
<img src="hello.png" />




browser                             Server




            hello.png
<img src="world.png" />
                        1


browser                             Server




                            …

            world.png
JS
<script src="script.js"></script>




browser                                       Server




             … alert('Hello, world'); …
JS
HTML   CSS
Web
HTML
<html>
 <head>
  <link rel="stylesheet" href="style.css" />
 </head>
 <body>
  <h1>Hello</h1>
  <script src="script.js"></script>
 </body>
</html>
index.html
CSS
h1 {
  color: red;
}
style.css
JS
script.js
window.addEventListener('load',
  function() {
    if (confirm('green?')) {
      document
        .querySelector('h1')
        .style.color = 'green';
    }
}, false);
OK
/*
function() {}                     */
window.addEventListener('load',
  function() {
    }
}, false);
/* green?                 OK
{}                        */
if (confirm('green?')) {
}
// <h1>
document
 .querySelector('h1')
 .style.color = 'green';
JS
JS   HTML   CSS…
JavaScriptの動かし方
JavaScriptの動かし方
JavaScriptの動かし方

More Related Content

What's hot

jQuery入門2 - イベント:千葉商科大学 Web動画表現
jQuery入門2 - イベント:千葉商科大学 Web動画表現jQuery入門2 - イベント:千葉商科大学 Web動画表現
jQuery入門2 - イベント:千葉商科大学 Web動画表現Atsushi Tadokoro
 
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシー
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシーjQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシー
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシーAtsushi Tadokoro
 
Latihan membuat website dengan tabel
Latihan membuat website dengan tabelLatihan membuat website dengan tabel
Latihan membuat website dengan tabelEko Siswanto
 
HTML入門 - 千葉商科大 Web表現
HTML入門 - 千葉商科大 Web表現HTML入門 - 千葉商科大 Web表現
HTML入門 - 千葉商科大 Web表現Atsushi Tadokoro
 
jQuery入門 - 芸大 Webデザイン演習B
jQuery入門 - 芸大 Webデザイン演習BjQuery入門 - 芸大 Webデザイン演習B
jQuery入門 - 芸大 Webデザイン演習BAtsushi Tadokoro
 
Web components copy
Web components copyWeb components copy
Web components copylulzaugusto
 
Analytics workshop deel 2
Analytics workshop deel 2Analytics workshop deel 2
Analytics workshop deel 2Tim Stierman
 

What's hot (18)

jQuery入門2 - イベント:千葉商科大学 Web動画表現
jQuery入門2 - イベント:千葉商科大学 Web動画表現jQuery入門2 - イベント:千葉商科大学 Web動画表現
jQuery入門2 - イベント:千葉商科大学 Web動画表現
 
Vernota
VernotaVernota
Vernota
 
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシー
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシーjQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシー
jQueryでつくる、動きのあるWebページ - 多摩美 メディアリテラシー
 
Latihan membuat website dengan tabel
Latihan membuat website dengan tabelLatihan membuat website dengan tabel
Latihan membuat website dengan tabel
 
JavaScript Dynamic Loading
JavaScript Dynamic LoadingJavaScript Dynamic Loading
JavaScript Dynamic Loading
 
HTML入門 - 千葉商科大 Web表現
HTML入門 - 千葉商科大 Web表現HTML入門 - 千葉商科大 Web表現
HTML入門 - 千葉商科大 Web表現
 
Seleccion
SeleccionSeleccion
Seleccion
 
Des Templates Heiliger Gral
Des Templates Heiliger GralDes Templates Heiliger Gral
Des Templates Heiliger Gral
 
Ver
VerVer
Ver
 
jQuery入門 - 芸大 Webデザイン演習B
jQuery入門 - 芸大 Webデザイン演習BjQuery入門 - 芸大 Webデザイン演習B
jQuery入門 - 芸大 Webデザイン演習B
 
Dynamic web 13
Dynamic web 13Dynamic web 13
Dynamic web 13
 
Web components copy
Web components copyWeb components copy
Web components copy
 
Enlace de prezy
Enlace de prezyEnlace de prezy
Enlace de prezy
 
F(1)
F(1)F(1)
F(1)
 
New Text Document
New Text DocumentNew Text Document
New Text Document
 
Analytics workshop deel 2
Analytics workshop deel 2Analytics workshop deel 2
Analytics workshop deel 2
 
The Tab widget
The Tab widgetThe Tab widget
The Tab widget
 
Web App Mvc
Web App MvcWeb App Mvc
Web App Mvc
 

JavaScriptの動かし方

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n