Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Final Study Guide for Introduction to Javascript | IT 1430, Study notes of Information Technology

final study guide Material Type: Notes; Professor: Aasheim; Class: Web Page Development; Subject: IT Information Technology; University: Georgia Southern University; Term: Fall 2010;

Typology: Study notes

2009/2010

Uploaded on 12/10/2010

kl88
kl88 🇺🇸

1 document

1 / 18

Toggle sidebar

Related documents


Partial preview of the text

Download Final Study Guide for Introduction to Javascript | IT 1430 and more Study notes Information Technology in PDF only on Docsity! Chapter 9 Part 1: Introduction to JavaScript Dr. Cheryl Aasheim IT 1430 Objectives In this chapter, you will:  Learn about the JavaScript programming language  Add structure to your JavaScript programs  Learn about logic and debugging Java versus JavaScript  Java  Advanced programming language  Created by Sun Microsystems  Considerably more difficult to master than JavaScript  Java programs are external programs that execute independent of browser  JavaScript  Runs within a Web page and controls the browser The <script> Element  JavaScript programs  Run from within a Web page  Code is typed directly into Web page code as separate section  Called scripts The <script> Element  <script> element: tells the Web browser that the scripting engine must interpret the commands it contains. <script type=“text/javascript”> statements </script> JavaScript prompt()  Script method used to prompt user for information  Syntax var var_name = prompt( message, default )  Example: var name = prompt( 'Please enter your name:', ' ' ); write() and writeln() Methods  Document object: Represents browser window’s content  To create new text on a Web page while the page is being rendered use the following methods for the Document object:  write() method  writeln() method write() and writeln() Methods  write() and writeln() methods  Require a text string as an argument  Difference between write() and writeln():  writeln() method adds a line break after the line of text Structuring JavaScript Code  Three rules for inserting JavaScript code:  Include a <script> element for each code section  Place code in the <head> or <body> sections  Create a JavaScript source file JavaScript Source File  File extension .js  Only contains JavaScript statements (no XHTML, no <script> element)  Use the src attribute in the <script> element in your XHTML file to access the external .js source file  Advantages of using an external .js source file Hiding JavaScript Code  Enclose the code within a <script> element in an XHTML comment block  Hides embedded code from incompatible browsers  JavaScript compatible browsers will ignore XHTML comment tags and execute the JavaScript code normally
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved