Java Script Eng : SAHAR. Programming Language HHL (High level language) لغات عالية المستوى LLL (Low level language) لغات منخفضة المستوى Java Script is.

Slides:



Advertisements
Similar presentations
Arrays in Flash What is an Array: What is an Array: Array is a list of cells, each cell in the list has a number to identify it (index or position). هي
Advertisements

Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
The Web Warrior Guide to Web Design Technologies
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
Information Technology Center Hany Abdelwahab Computer Specialist.
WTP Unit 4 JavaScript and DHTML. Javascript: – Client side scripting, – What is Javascript, – How to develop Javascript, – Simple Javascript, – Variables,
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript for Python Programmers
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
Scripting Languages.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
JavaScript Part 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Using Client-Side Scripts to Enhance Web Applications 1.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
JavaScript - A Web Script Language Fred Durao
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
JavaScript Adding active content to websites. Goals Understand structure of JavaScript Understand rules of coding Add active content to WebPages Add functions.
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
1 JavaScript
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
JavaScript JavaScript Introduction. Q. What is JavaScript? Ans. JavaScript was designed to add interactivity to HTML pages. JavaScript is a scripting.
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.
ECA 225 Applied Interactive Programming ECA 225 Applied Online Programming control structures, events, objects.
Making dynamic pages with javascript Lecture 1. Java script java versus javascript Javascript is a scripting language that will allow you to add real.
Pertemuan 5 IT133 Pengembangan Web JavaScript. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
This is our seminar JavaScript And DOM This is our seminar JavaScript And DOM.
Chapter 5: Intro to Scripting CIS 275—Web Application Development for Business I.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
JavaScript: A short introduction Joseph Lee Created by Joseph Lee.
WEB SYSTEMS & TECHNOLOGY. Java Script  JavaScript created by Netscape  It is also client side programming  It can be use for client side checks.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
>> Introduction to JavaScript
CHAPTER 10 JAVA SCRIPT.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Web Development & Design Foundations with HTML5
WEB APPLICATION PROGRAMMING
Javascript Short Introduction By Thanawat Varintree,
14 A Brief Look at JavaScript and jQuery.
Chapter 19 JavaScript.
Javascript الجافا سكربت هي لغة برمجه اذا جاز التعبیر تلعب دور حیوي وفعال في صفحات الویب من خلال القیام بوظائف قد تكون خارجیة او داخلیة بل لنكن اكثر دقة.
WEB PROGRAMMING JavaScript.
برمجة صفحات إنترنت (JavaScript )
T. Jumana Abu Shmais – AOU - Riyadh
CS105 Introduction to Computer Concepts
Tutorial 10: Programming with javascript
Web Programming– UFCFB Lecture 13
Introduction to JavaScript
CS105 Introduction to Computer Concepts JavaScript
Presentation transcript:

Java Script Eng : SAHAR

Programming Language HHL (High level language) لغات عالية المستوى LLL (Low level language) لغات منخفضة المستوى Java Script is HLL

Usage of JavaScript Creating a Programmable Web Page

Introduction to JavaScript JavaScript is an interpreted programming or script language from Netscape. JavaScript is used in Web site development to such things as:  automatically change a formatted date on a Web page  cause a linked-to-page to appear in a popup window  cause text or a graphic image to change during a mouse rollover

Writing a JavaScript Program JavaScript programs can either be placed directly into the HTML file or they can be saved in external files. The Web browser runs a JavaScript program when the Web page is first loaded, or in response to an event. بيتم كتابة أكواد الجافا في أي مكان داخل كود HTML أي يمكن كتابتها في أو في بيظهر أثر الكود في صفحة المتصفح

How To Write Java Script In HTML ………. Java Script Code

OR ………. Java Script Code

Write Java Script Code

Alert Code بيستخدم لإظهار رساله تلقائيه للمستخدم حين فتحه للموقع Alert (“ نص الرسالة ”); ; تستخدم لإنهاء السطر

Save Project لحفظ البرنامج بيتم الحفظ بإمتداد html و يتم ضبط encoding علي UTF-8 وذلك لكي ندعم إستخدام كل اللغات بما فيهم اللغة العربيه File  save (name.html utf-8)

EX: 1. إظهار رسالة ” welcome“ للمستخدم عند بدإ فتح الصفحة 2. إظهار رسالة ” HIIIIII“ للمستخدم بعد إظهار رسالة ” Welcome“

EX1 JavaScript alert ("welcome");

EX 2 JavaScript alert ("welcome"); alert (“HIIIII");

Calculations يوجد بلغات البرمجة أولويات للعمليات الحسابيه و حيث أن العمليات الحسابيه هي +, -, *, /, ^ لذلك نتبع إستخدام الأقواس لضبط العمليه الحسابية الترتيب الذي تأخذه العمليات الحسابيه الأسس ثم القسمه أو الضرب تم الجمع أو الطرح

How To Use operation in Alert Alert ((5+15)*3);

OOP البرمجه الشيئيه بتتكون من كائنات لها أحداث و يصاحبها أفعال ( وظائف ) و لها خصائص لغة الجافا سكربت من البرمجه الشيئيه لذلك فهي لها كل ما سبق

Window.Alert لأن alert هو الفعل المصاحب للكائن (Window) AS : Window Alert (“Welcome”);

Others For Alert Alert ( “ Welcome \n Ali”) Alert ( “ Welcome \t Ali”) \n تعني الكتابه في سطر جديد \t تعني ترك مسافه

Document. Write للكتابه داخل الصفحة Document. Write (“ النص المراد كتابته ”) EXAMPLE ???????????

Variables A variable is a named element in a program that stores information. The following restrictions apply to variable names المقصود بالمتغيرات هي حجز أماكن في زاكرة الجهاز ففي لغة الجافا سكربت تعرف المتغیرات ب.( Var )

Condition To Type Variable لا يوجد بها مسافة لا تستخدم العلامات الخاصه ك (#, ^, &, * … etc) تكتب كلها إما Capital أو Small و يفضل أن تكتب Small لا يمكن التسميه باللغة العربيه لا يمكن بدء الإسم برقم لا تستخدم الكلمات المحجوزه

الكلمات المحجوزه بالجافا breake case continue delete do else false for function if in new null return switch this true typeof var voide while with

Variables Var x ; Var x = Num; Var x = “ Name”; EX : Var x = “ Welcome”; Var x = 5;

Window. Confirm تستخدم لإظهار رساله للمستخدم لكنها مختلفه عن رسالة Alert Window. confirm (“Are You Sure??”) بتظهر رساله فيها OK, Cancel

Window. Prompt تستخدم لإظهار رساله للمستخدم يمكنه الكتابه فيها Window. prompt (“Your Name?"," Name”)

EX: نريد إظهار رسالة للمستخدم تسأله عن إسمه ثم بعد ذلك يرحب بإسم الشخص في الصفحة //Var X ; X = window prompt (“Your Name"," Name”); Document. Write (“Welcome” +X)

External Code بيتم كتابة الكود خارج الصفحة ؤ يتم إستدعاؤه بها Note My Code  External File Name JS  Extention

IF Statement IF ( الشرط ) { جواب الشرط } EX حساب مجموع كلا من المتغيرين X,Y حيث X=10 Y = 20 و إظهر المجموع في رسالة

Var x = 10; Var y =20 ; Var sum = 0; IF sum ==0 { sum = x+ y; Window. Alert (“total is”+” ” + Sum); }

IF Statement IF ( الشرط ) { جواب الشرط } Else IF ( الشرط ) { جواب شرط أخر } Else ( الشرط ) { جواب شرط أخر }

EX: Var x = 0 ; If (x==0){ Window. alert (“ صفر ”); } Else If (x > 0){ Window. alert (“ رقم موجب ”); } Else If (x< 0){ Window. alert (“ رقم سالب ”); }

Else { Window. alert (“ ليس رقما ”); }

Event < Input type =“button” value = “ click “ On click = “ alert (‘you clicked me ‘)” > يظهر Button عند الضغط عليه يعطي رسالة

Function Function msg () { Alert (“you clicked me ”) ; } Input type “button” value = “ click “ On click =msg ();

Switch Case Switch ( ) { Case “ “ : Alert (“ ”); break ; Default : Alert ( “ ” ) }

var country ; country=window. prompt( “ أدخل الدولة لتعرف عاصمتها "); switch ( country ) { Case ” مصر ” : document. write(" عاصمتها القاهره ") ; break ; Case “ العراق ” : document. write(" عاصمتها بغداد ") ; break; Case “ السودان ” : document. write(" عاصمتها الخرطوم ") ; break ; default : document. write(" الدولة التي أدخلتها لیست من ضمن الخیارات المتاحة ") ; }

Arrays تستخدم لتعريف المتغيرات فهي أشبه ما يكون بالجدول حيث يمكننا تخزين متغير واحد في مجموعة من الخانات يمكن أن تكون القيم رقميه او نصية Var …… = new Array (“.... “, “….”, ”….” ) عناصر المصفوفه إسم المتغير

EX: Var names = new Array (“ Ali “, “Ahmed”, ”samy” ); Alert (names[0]);

Another Method to Define Array Var Names = new Array (); Names [0] = “Ali”; Names [1] = “Ahmed”; Names [2] = “Samy”; Names [3] = “Ramy”; Alert ( Name[..] );

Loops FOR LOOP For ( Initial value; condition; increment ) { }

EX : for (i=0 ; i<10 ; i++) { document.write("welcome " ); }

While Loop Var I = 0 ; While (i<0) { Document.write ( “ welcome ”); i++ ; }

do …..while Var i = 0 ; do { document.write ( “ welcome “); i++ ; } while (i<10);

String السلاسل النصيه EX : Var text = “how are you”; Document. write (text) Document. write (text. bold()); لجعل النص سميك

Document. write (text. bold(). Strike()); لجعل النص سميك و مشطوب Document. write (text. font color (“red”)); لتغيير لون النص Document. write (text.toUpperCase ()); لجعل أحرف النص كبير Document. write (text.toLowerCase ()); لجعل أحرف النص صغيره

Text. length Document. write (text. length ) تستخدم لتحديد طول النص المكتوب و هي Property وليست Method فلذلك لا يتبعها أقواس ()

Index Of & Match Index of  Position of The first letter of text Match  the text

EX: Var text = “ How are you Ali ?“; Document. Write (text. index of (“Ali”); Document. Write (text. match of (“Ali”);

What about ???? Document. Write (text. index of (“ali”); Or Document. Write (text. index of (“Ahmed”); Document. Write (text. match of (“ali”); Or Document. Write (text. match of (“Ahmed”);