SlideShare a Scribd company logo
JavaScript How To                                                                   file:///C:/Users/julian/AppData/Roaming/Mozilla/Firefox/Profiles/vwqzts...



         JS Basic
         JS HOME
                                  JavaScript How To
         JS Introduction
         JS How To                « Previous                                                                   Next Chapter »
         JS Where To
         JS Statements
         JS Comments              The HTML <script> tag is used to insert a JavaScript into an HTML page.
         JS Variables
         JS Operators
         JS Comparisons           Put a JavaScript into an HTML page
         JS If...Else
         JS Switch                The example below shows how to use JavaScript to write text on a web page:
         JS Popup Boxes
         JS Functions
         JS For Loop               Example
         JS While Loop
         JS Break Loops             <html>
         JS For...In                <body>
         JS Events                  <script type="text/javascript">
         JS Try...Catch             document.write("Hello World!");
         JS Throw                   </script>
         JS Special Text            </body>
         JS Guidelines              </html>

         JS Objects                  Try it yourself »
         JS Objects Intro
         JS String
         JS Date                  The example below shows how to add HTML tags to the JavaScript:
         JS Array
         JS Boolean
         JS Math
                                   Example
         JS RegExp
                                    <html>
                                    <body>
         JS Advanced
                                    <script type="text/javascript">
         JS Browser                 document.write("<h1>Hello World!</h1>");
         JS Cookies                 </script>
         JS Validation              </body>
         JS Animation               </html>
         JS Image Maps
         JS Timing
         JS Create Object            Try it yourself »
         JS Summary

         JS Examples
         JS   Examples            Example Explained
         JS   Objects Examples
         JS   Browser Examples    To insert a JavaScript into an HTML page, we use the <script> tag. Inside the <script> tag we
         JS   HTML DOM Examples   use the type attribute to define the scripting language.
         JS   Quiz
         JS   Exam                So, the <script type="text/javascript"> and </script> tells where the JavaScript starts and ends:

         JS References             <html>
         JavaScript Objects        <body>
         HTML DOM Objects          <script type="text/javascript">
                                   ...
                                   </script>
                                   </body>
                                   </html>

                                  The document.write command is a standard JavaScript command for writing output to a page.

                                  By entering the document.write command between the <script> and </script> tags, the browser
                                  will recognize it as a JavaScript command and execute the code line. In this case the browser will
                                  write Hello World! to the page:

                                   <html>
                                   <body>
                                   <script type="text/javascript">
                                   document.write("Hello World!");
                                   </script>
                                   </body>
                                   </html>

                                  Note: If we had not entered the <script> tag, the browser would have treated the
                                  document.write("Hello World!") command as pure text, and just write the entire line on the page.
                                  Try it yourself


                                  How to Handle Simple Browsers
                                  Browsers that do not support JavaScript, will display JavaScript as page content.

                                  To prevent them from doing this, and as a part of the JavaScript standard, the HTML comment tag
                                  should be used to "hide" the JavaScript.

                                  Just add an HTML comment tag <!-- before the first JavaScript statement, and a --> (end of




1 de 1                                                                                                                                 29/05/2010 10:44 p.m.

More Related Content

What's hot (20)

PDF
Chrome DevTools Basics
Low-Code Starter Pack
 
PPT
Java Script
siddaram
 
PPT
JavaScript Missing Manual, Ch. 1
Gene Babon
 
PDF
倔倔和Javascript的那些事儿
Ting Lv
 
PDF
[WEB UI BASIC] CSS_1
Jae Woo Woo
 
PDF
What is HTML
Low-Code Starter Pack
 
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPT
Javascript 2009
borkweb
 
PPTX
Javascipt
Shreyans Gandhi
 
PPTX
Javascript ch8
Brady Cheng
 
PDF
22 j query1
Fajar Baskoro
 
PDF
Assignment4
H K
 
PPTX
Javascript
Mozxai
 
DOCX
Introduction of javascript
syeda zoya mehdi
 
DOCX
jQuery Code Testing
Elizabeth Pisarek
 
PPTX
2.java script dom
PhD Research Scholar
 
PPTX
Java script Advance
Jaya Kumari
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PPTX
Intro to java script
londiem
 
PPTX
Java script cookies
AbhishekMondal42
 
Chrome DevTools Basics
Low-Code Starter Pack
 
Java Script
siddaram
 
JavaScript Missing Manual, Ch. 1
Gene Babon
 
倔倔和Javascript的那些事儿
Ting Lv
 
[WEB UI BASIC] CSS_1
Jae Woo Woo
 
What is HTML
Low-Code Starter Pack
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Javascript 2009
borkweb
 
Javascipt
Shreyans Gandhi
 
Javascript ch8
Brady Cheng
 
22 j query1
Fajar Baskoro
 
Assignment4
H K
 
Javascript
Mozxai
 
Introduction of javascript
syeda zoya mehdi
 
jQuery Code Testing
Elizabeth Pisarek
 
2.java script dom
PhD Research Scholar
 
Java script Advance
Jaya Kumari
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
Intro to java script
londiem
 
Java script cookies
AbhishekMondal42
 

Similar to Java script how to (20)

PPT
JavaScript - Part-1
Jainul Musani
 
PPTX
JavaScript - Getting Started.pptx
JonnJorellPunto
 
PPT
JAVA SCRIPT
Go4Guru
 
PPTX
Java script writing javascript
Jesus Obenita Jr.
 
PPT
Javascript
Manav Prasad
 
PDF
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 
PDF
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 
PDF
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
tutorialsruby
 
PDF
&lt;img src="../i/r_14.png" />
tutorialsruby
 
PPTX
Java script
rajshreemuthiah
 
PPT
Java script Learn Easy
prince Loffar
 
PPTX
JavaScript with Syntax & Implementation
Soumen Santra
 
PPT
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
PPTX
Introduction to JavaScript
Sudhanshu815882
 
PPT
Javascript by geetanjali
Geetanjali Bhosale
 
PPS
Java script
Mohammed Sheikh Salem
 
PDF
Intro to Javascript and jQuery
Shawn Calvert
 
DOC
Introduction to java script
nanjil1984
 
DOC
Java script by Act Academy
actanimation
 
PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
JavaScript - Part-1
Jainul Musani
 
JavaScript - Getting Started.pptx
JonnJorellPunto
 
JAVA SCRIPT
Go4Guru
 
Java script writing javascript
Jesus Obenita Jr.
 
Javascript
Manav Prasad
 
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 
Essential_Javascript_--_A_Javascript_Tutorial
tutorialsruby
 
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
tutorialsruby
 
&lt;img src="../i/r_14.png" />
tutorialsruby
 
Java script
rajshreemuthiah
 
Java script Learn Easy
prince Loffar
 
JavaScript with Syntax & Implementation
Soumen Santra
 
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
Introduction to JavaScript
Sudhanshu815882
 
Javascript by geetanjali
Geetanjali Bhosale
 
Intro to Javascript and jQuery
Shawn Calvert
 
Introduction to java script
nanjil1984
 
Java script by Act Academy
actanimation
 
Basic JavaScript Tutorial
DHTMLExtreme
 
Ad

More from julian vega (20)

PPTX
REFLEXION SOBRE LA VIDA DE JESUS PARA EL 8 DE JULIO
julian vega
 
PPTX
Rosa
julian vega
 
PPTX
Exposición noveno final nov
julian vega
 
DOC
Tallerexploracionnoveno
julian vega
 
PPTX
Herramientas web 2.0
julian vega
 
PPTX
Noveno renacimiento
julian vega
 
PDF
Borges
julian vega
 
PDF
Indu00010intro1
julian vega
 
PDF
Cuestionario 9
julian vega
 
PDF
Cuestionario8rta
julian vega
 
PDF
Glosario noveno
julian vega
 
DOCX
Noveno lecturas
julian vega
 
PPTX
Flujogramas noveno taller construccion 2
julian vega
 
PPT
Arte 00
julian vega
 
PPT
Arte prehistorico
julian vega
 
PPT
Arte neolitico
julian vega
 
PPT
Arte neolitico 01
julian vega
 
PPT
Mesopotamia 01
julian vega
 
PPT
Analisis tecnico de objetos
julian vega
 
PDF
Logro3 Informe1 Informe Slideshare
julian vega
 
REFLEXION SOBRE LA VIDA DE JESUS PARA EL 8 DE JULIO
julian vega
 
Exposición noveno final nov
julian vega
 
Tallerexploracionnoveno
julian vega
 
Herramientas web 2.0
julian vega
 
Noveno renacimiento
julian vega
 
Borges
julian vega
 
Indu00010intro1
julian vega
 
Cuestionario 9
julian vega
 
Cuestionario8rta
julian vega
 
Glosario noveno
julian vega
 
Noveno lecturas
julian vega
 
Flujogramas noveno taller construccion 2
julian vega
 
Arte 00
julian vega
 
Arte prehistorico
julian vega
 
Arte neolitico
julian vega
 
Arte neolitico 01
julian vega
 
Mesopotamia 01
julian vega
 
Analisis tecnico de objetos
julian vega
 
Logro3 Informe1 Informe Slideshare
julian vega
 
Ad

Recently uploaded (20)

PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
community health nursing question paper 2.pdf
Prince kumar
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 

Java script how to

  • 1. JavaScript How To file:///C:/Users/julian/AppData/Roaming/Mozilla/Firefox/Profiles/vwqzts... JS Basic JS HOME JavaScript How To JS Introduction JS How To « Previous Next Chapter » JS Where To JS Statements JS Comments The HTML <script> tag is used to insert a JavaScript into an HTML page. JS Variables JS Operators JS Comparisons Put a JavaScript into an HTML page JS If...Else JS Switch The example below shows how to use JavaScript to write text on a web page: JS Popup Boxes JS Functions JS For Loop Example JS While Loop JS Break Loops <html> JS For...In <body> JS Events <script type="text/javascript"> JS Try...Catch document.write("Hello World!"); JS Throw </script> JS Special Text </body> JS Guidelines </html> JS Objects Try it yourself » JS Objects Intro JS String JS Date The example below shows how to add HTML tags to the JavaScript: JS Array JS Boolean JS Math Example JS RegExp <html> <body> JS Advanced <script type="text/javascript"> JS Browser document.write("<h1>Hello World!</h1>"); JS Cookies </script> JS Validation </body> JS Animation </html> JS Image Maps JS Timing JS Create Object Try it yourself » JS Summary JS Examples JS Examples Example Explained JS Objects Examples JS Browser Examples To insert a JavaScript into an HTML page, we use the <script> tag. Inside the <script> tag we JS HTML DOM Examples use the type attribute to define the scripting language. JS Quiz JS Exam So, the <script type="text/javascript"> and </script> tells where the JavaScript starts and ends: JS References <html> JavaScript Objects <body> HTML DOM Objects <script type="text/javascript"> ... </script> </body> </html> The document.write command is a standard JavaScript command for writing output to a page. By entering the document.write command between the <script> and </script> tags, the browser will recognize it as a JavaScript command and execute the code line. In this case the browser will write Hello World! to the page: <html> <body> <script type="text/javascript"> document.write("Hello World!"); </script> </body> </html> Note: If we had not entered the <script> tag, the browser would have treated the document.write("Hello World!") command as pure text, and just write the entire line on the page. Try it yourself How to Handle Simple Browsers Browsers that do not support JavaScript, will display JavaScript as page content. To prevent them from doing this, and as a part of the JavaScript standard, the HTML comment tag should be used to "hide" the JavaScript. Just add an HTML comment tag <!-- before the first JavaScript statement, and a --> (end of 1 de 1 29/05/2010 10:44 p.m.