آموزش طراحی وب سایت جلسه یازدهم – جاوا اسکریپت 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: 09125773990 09371410986 پست الکترونیک :

Slides:



Advertisements
Similar presentations
آموزش طراحی وب سایت جلسه اول – معرفی مفاهیم اولیه تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Advertisements

CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
The Web Warrior Guide to Web Design Technologies
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
آموزش طراحی وب سایت جلسه نهم – نکات تکمیلی سی اس اس تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک.
Executes a statement or statements for a number of times – iteration. Syntax for(initialize; test; increment) { // statements to be executed } Initial.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript for Python Programmers
Introduction To JavaScript What JavaScript Is: a general purpose scripting language that allows a static page to interact with users and respond to events.
JavaScript Switch Statement. Switch JavaScript Switch Statement If you have a lot of conditions, you can use a switch statement instead of an if…elseif…
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
آموزش طراحی وب سایت جلسه دهم – جاوا اسکریپت 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
JS: DOM Form Form Object Form Object –The Form object represents an HTML form. –For each instance of a tag in an HTML document, a Form object is created.
آموزش طراحی وب سایت جلسه سوم– لینک ها و آدرس دهی تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Loops Doing the same thing over and over and over and over and over and over…
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
JavaScript Part 1.
آموزش طراحی وب سایت جلسه پانزدهم – بهینه سازی برای موتور جستجو تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
JavaScript For...In Statement The for...in statement loops through the elements of an array or through the properties of an object. Syntax for (variable.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
1 JavaScript
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
آموزش طراحی وب سایت جلسه دوم – جداول تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
JavaScript, Fourth Edition
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
آموزش طراحی وب سایت جلسه چهاردهم- استانداردهای طراحی سایت تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک.
COMP403 Web Design JAVA SCRİPTS Tolgay KARANFİLLER.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
IS2802 Introduction to Multimedia Applications for Business Lecture 3: JavaScript and Functions Rob Gleasure
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Making dynamic pages with javascript Lecture 1. Java script java versus javascript Javascript is a scripting language that will allow you to add real.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Pertemuan 5 IT133 Pengembangan Web JavaScript. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
In God we trust Learning Java Script. Java Script JavaScript is the scripting language of the Web! JavaScript is used in millions of Web pages to improve.
JavaScript Lectures Level 7. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting.
Web Development JavaScript. Introduction to JavaScript.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Event Handlers. Introduction An event handler executes a segment of a code based on certain events occurring within the application, such as.
JavaScript محمد احمدی نیا 2 Of 48 What is JavaScript?  JavaScript was designed to add interactivity to HTML pages  A scripting.
This is our seminar JavaScript And DOM This is our seminar JavaScript And DOM.
CGS 3066: Web Programming and Design Spring 2016 Programming in JavaScript.
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.
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript JavaScript ( Condition and Loops ). Conditional Statements If Statement If...else Statement if (condition) { code to be executed if condition.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
JavaScript Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer,
Third lecture Event 27/2/2016 JavaScript Tutorial.
Build in Objects In JavaScript, almost "everything" is an object.
Unit 20 - Client Side Customisation of Web Pages
“Under the hood”: Angry Birds Maze
Intro to JavaScript CS 1150 Spring 2017.
JavaScript (JS) Basics
JavaScript Defined General Syntax Body vs. Head Variables Math & Logic
Web Design and Development
Web Programming and Design
Presentation transcript:

آموزش طراحی وب سایت جلسه یازدهم – جاوا اسکریپت 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :

Web Design Training Java Scripts #2 Part 11 Author :Babak Tavatav

JavaScript For Loop for (var=startvalue;var<=endvalue;var=var+incre ment) { code to be executed }

for (i = 0; i <= 5; i++) { document.write("The number is " + i); document.write(" "); } Explanation: This for loop starts with i=0. As long as i is less than, or equal to 5, the loop will continue to run. i will increase by 1 each time the loop runs.

The while Loop The while loop loops through a block of code while a specified condition is true. Syntax: while (var<=endvalue) { code to be executed } Note: The <= could be any comparing operator.

i=0; while (i<=5) { document.write("The number is " + i); document.write(" "); i++; } Explanation: i is equal to 0. While i is less than, or equal to, 5, the loop will continue to run. i will increase by 1 each time the loop runs.

The do...while Loop The do...while loop is a variant of the while loop. This loop will execute the block of code ONCE, and then it will repeat the loop as long as the specified condition is true. Syntax do { code to be executed } while (var<=endvalue);

i = 0; do { document.write("The number is " + i); document.write(" "); i++; } while (i <= 5) Explanation: i equal to 0. The loop will run i will increase by 1 each time the loop runs. While i is less than, or equal to, 5, the loop will continue to run.

JavaScript Break and Continue Statements

var i=0; for (i=0;i<=10;i++) { if (i==3) { break; } document.write("The number is " + i); document.write(" "); } Explanation: The loop will break when i=3.

The continue Statement The continue statement will break the current loop and continue with the next value.

var i=0; for (i=0;i<=10;i++) { if (i==3) { continue; } document.write("The number is " + i); document.write(" "); } Explanation: The loop will break the current loop and continue with the next value when i=3.

exercise JavaScript For...In Statement

Events By using JavaScript, we have the ability to create dynamic web pages. Events are actions that can be detected by JavaScript. Every element on a web page has certain events which can trigger a JavaScript. For example, we can use the onClick event of a button element to indicate that a function will run when a user clicks on the button. We define the events in the HTML tags. Examples of events: A mouse click A web page or an image loading Mousing over a hot spot on the web page Selecting an input field in an HTML form Submitting an HTML form A keystroke

The try...catch Statement The try...catch statement allows you to test a block of code for errors. The try block contains the code to be run, and the catch block contains the code to be executed if an error occurs. Syntax try { //Run some code here } catch(err) { //Handle errors here }

var txt=""; function message() { try { adddlert("Welcome guest!"); } catch(err) { txt="There was an error on this page.\n\n"; txt+="Error description: " + err.description + "\n\n"; txt+="Click OK to continue.\n\n"; alert(txt); }

var txt=""; function message() { try { adddlert("Welcome guest!"); } catch(err) { txt="There was an error on this page.\n\n"; txt+="Click OK to continue viewing this page,\n"; txt+="or Cancel to return to the home page.\n\n"; if(!confirm(txt)) { document.location.href=" } } }

JavaScript Special Characters CodeOutputs \'single quote \"double quote \&ampersand \\backslash \nnew line \rcarriage return \ttab \bbackspace \fform feed

JavaScript Objects

Object Oriented Programming Properties Methods

var txt="Hello World!"; document.write(txt.length);

var str="Hello world!"; document.write(str.toUpperCase());

The END