Style properties in JavaScript

Slides:



Advertisements
Similar presentations
The Web Warrior Guide to Web Design Technologies
Advertisements

Executes a statement or statements for a number of times – iteration. Syntax for(initialize; test; increment) { // statements to be executed } Initial.
Computer Science 103 Chapter 3 Introduction to JavaScript.
1 The Information School of the University of Washington Oct 30fit review Programming Review INFO/CSE 100, Fall 2006 Fluency in Information Technology.
Oct 25 1 The Information School of the University of Washington fit control © 2006 University of Washington Control Flow INFO/CSE 100, Fall 2006.
Introduction to JavaScript for Python Programmers
Lesson15. JavaScript Objects Objects encapsulate data (properties) and behavior(methods); the properties and the methods of an object are tied together.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
The Document Object Model. Goals Understand how a JavaScript can communicate with the web page in which it “lives.” Understand how to use dot notation.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
JavaScript Part 1.
Database-Driven Web Sites, Second Edition1 Chapter 3 INTRODUCTION TO CLIENT-SIDE SCRIPTS.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part Two.
1 CLIENT-SIDE SCRIPTS. Objectives 2 Learn how to reference objects in HTML documents using the HTML DOM and dot syntax Learn how to create client-side.
Functions and Objects. First Midterm exam Date: 10/10/2006 (Tuesday) Content: Multiple choices Determine results of the code Write codes Covert everything.
Functions and Objects. First Midterm exam Date: October 8, 2008 Content: Two parts: On-paper:Multiple choices On-computer: Write codes Cover everything.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
The Web Wizard’s Guide To JavaScript Chapter 8 Working with Windows and Frames.
JavaScript, Fourth Edition
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
Making dynamic pages with javascript Lecture 1. Java script java versus javascript Javascript is a scripting language that will allow you to add real.
Lesson 16. Practical Application 1 We can take advantage of JavaScript and the DOM, to set up a form so that the first text box of a form automatically.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 9.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
XHTML Forms.
Build in Objects In JavaScript, almost "everything" is an object.
CHAPTER 10 JAVA SCRIPT.
>> JavaScript: Location, Functions and Objects
“Under the hood”: Angry Birds Maze
Tutorial 10 Programming with JavaScript
Web Development & Design Foundations with HTML5
CHAPTER 4 CLIENT SIDE SCRIPTING PART 3 OF 3
JavaScript is a programming language designed for Web pages.
Functions Comp 205 Fall ‘17.
JavaScript: Functions
SEEM4570 Tutorial 05: JavaScript as OOP
JavaScript Functions.
JavaScript Syntax and Semantics
JavaScript Create Array object
Week#2 Day#1 Java Script Course
JavaScript Selection Statement Creating Array
IF if (condition) { Process… }
Introduction to JavaScript for Python Programmers
The Web Wizard’s Guide To JavaScript
JavaScript What is JavaScript? What can JavaScript do?
The Internet 11/22/11 Conditionals and Loops
JavaScript What is JavaScript? What can JavaScript do?
The Web Wizard’s Guide To JavaScript
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
The <script> Tag
CIS 136 Building Mobile Apps
Programming Basics Review
JavaScript 101 Lesson 8: Loops.
Presentation transcript:

Style properties in JavaScript Inline code with window and Date object Passing query to Google Creating Functions Creating Array Selection Statement  if…else

Style properties in JavaScript style.backgroundImage style.backgroundColor style.border style.margin style.padding style.filter style.visibility style.position style.top style.left style.color style.fontSize style.fontWeight style.width

Inline code with window and Date object Inline code found between <script> and </script> tag. Inline code is invoked or executed when the browser gets up to the line of code <body> <script type=“text/javascript”> <!-- var name= window.prompt(“question”, “initial value”); var d = new Date(); var day= d.getDate(); //--> </script> </body>

Passing query to Google Step 1: Create a text field. Assign a name to the field Step 2: Create a button. Using an event handler, send the text value to google.

Creating Functions Function contains a set of statements performing a single task Major advantage of having function is programmer’s ability to reuse Syntax:  function with no parameter function funName() { }  function with parameter function funName( para1, para2, etc) { }

Calling Functions A function has to be called in order to be executed. This can be done through event handler or inline technique Syntax //calling function with no parameter funName() // calling function with parameter funName(argument1, argument2, etc)

Creating Array Array object stores a list of values Each value is an element of the Array and has an associated index Create array with initial values var arrayName = new Array(elment0, element1, element2, etc); Create array with size defined var arrayName = new Array(3); arrayName[0] = value; arrayName[1] = value; arrayName[2] = value;

Selection Statement Selection or conditional statements perform different actions based on different conditions If Statement Syntax if( condition ) Statement Semantics Evaluate the condition (true or false) If the condition is true True: DO STATEMENT False: SKIP the STATEMENT

Selection Statments Syntax: if…else if(condition) { if the condition is true, the code in here is executed} else { if the code is false, the code in here is executed}