INTRODUCTION TO JAVASCRIPT. JAVASCRIPT ► JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies,

Slides:



Advertisements
Benzer bir sunumlar
JavaScript Birinci Hafta.
Advertisements

Gerekli olduğunda insanlara ulaşın Yer Uzantıları Reach prospective customers at important moment with location extensions. Location Extentions.
Alakalı müşterileri hedefleyin. Google ile Yeniden Pazarlama Remarketing with Google. Target customers who are already showing interest in your business.
JAVA SCRIPT TEMELLERİ.
İNTERNET PROGRAMCILIĞI I BTP 207 Ders 9. Tek değişkende birden fazla bilgi tutulmak istendiğinde kullanılır. Kullanım şekli: var dizi_adı= new Array(eleman1,
If you delete this after reading... you'll spend a year of ill luck! But... if you send it to (at least) 2 friends... you'll have 3 years of good luck!!!
Üniversitemiz Öğrenci Bilgi Sistemine Kullanıcı Adı (Öğrenci Numarası ) ve tarafınızdan belirlenen Şifre ile giriş yapılır; You can have access to Student.
If you delete this after reading... you'll spend a year of ill luck! But... if you send it to (at least) 2 friends... you'll have 3 years of good luck!!!
Bir Problemin Programa Dönüştürülme Süreci
Hareket halindeki insanlara ulaşın.Mobil Arama Ağı Reklamları Reach customers with Mobile Search Network.
.NET Framework 2.0 Öğr. Gör. Dr. Mustafa Cem Kasapbaşı Hafta 1 Ref Beginning ASP.NET 2.0 in C# 2005 From Novice to Professional İnternet Programlama Dilleri.
NOUN CLAUSES (İSİM CÜMLECİKLERİ).
DEVRE TEOREMLERİ.
Kabuk Programlama Shell Scripting(bash)
Bilgisayarlar kodu nasıl işler?
COMPANY Veritabanı Örneği (Gereksinimler)
Kampanyanızı optimize edin. Görüntülü Reklam Kampanyası Optimize Edici'yi Kullanma Display Ads Campaign Optimizer. Let Google technology manage your diplay.
Introduction.
COSTUMES KILIKLAR (KOSTÜMLER)
Gizli / İsimsiz Raporlama Tanıtımı
ISE Senior Project Fall 2015.
BM-305 Mikrodenetleyiciler Güz 2015 (6. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Yapısal Programlama Yüksek Düzeyli Dillerin Gelişim Süreci – , Fortran (by IBM), for creating scientific and engineering applications, first commercial.
Database for APED Büşra Bilgili | Emirhan Aydoğan | Meryem Şentürk | M. Arda Aydın COMPE 341.
IF if (şart) { İşlemler… }
S ÜLEYMAN Ş AH ÜN İ VERS İ TES İ DERS KAYIT İŞ LEMLER İ / COURSE REGISTRATION PROCESS.
21/02/2016 A Place In My Heart Nana Mouskouri « Istanbul « (A Different Adaptation)
Web Teknolojileri Hafta 6 1. İçerik  Javascript 2.Kısım 2.
Improvement to Rankine cycle
Practice your writing skills
First Conditional Sentences. LOOK AT THE EXAMPLES If the weather is fine, we’ll play tenis If I have enough money, I’ll buy the car If it rains, we’ll.
CHILD PORNOGRAPHY IŞIK ÜNİVERSİTESİ
Algoritma ve Programlama
INTRODUCTION TO JAVASCRIPT
İSTATİSTİK II Hipotez Testleri 1.
INTRODUCTION TO JAVASCRIPT
BİLİMSEL ÇALIŞMA BASAMAKLARI SCIENTIFIC WORKING STEPS MHD BASHAR ALREFAEI Y
German shepherd dog. These dogs are said to be intelligent before they say.
Bilgisayarlar kodu nasıl işler?
Bir Problemin Programa Dönüştürülme Süreci
Web Programming– UFCFB Lecture 13
W O R D A M G E U FOR N I T 1.
The Need for Program Design
Chapter 1 (Bölüm 1) The accounting equation(muhasebe denklemi) and the balance sheet(bilanço)
INTRODUCTION TO JAVASCRIPT
INTRODUCTION TO JAVASCRIPT
PUANLAMA ÖNERİSİ *Öğrenciler iki gruba ayrılır. Her iki gruba da baştan 1000’er puan verilir. *Birinci grup yarışırken “GAME 1“ açılır. Öğrenciler her.
If you delete this after reading... you'll spend a year of ill luck!
Future: I will/shall & I am going to. Structure: Subject+will/shall+verb(base form)+object.
tomorrow soon next week / year in five minutes/ in two hours later today I'll go to the market tomorrow. Don’t worry. He will be here soon. There.
Döngüler ve Shift Register
NİŞANTAŞI ÜNİVERSİTESİ
İSTATİSTİK II Hipotez Testleri 1.
Turkish cuisine is very popular around the world. It has a very wide options for everyone. The variety of the recipes and the ingredients which are grown.
NİŞANTAŞI ÜNİVERSİTESİ
The Need for Program Design
BİLL GATES Şule Eslem ÖZTÜRK NUN OKULLARI Prep-A.
NİŞANTAŞI ÜNİVERSİTESİ
NİŞANTAŞI ÜNİVERSİTESİ
Feminism, unlike the idea of ​​ mankind, is a trend that is prioritized to bring gender inequality to the agenda. The notion of feminism, which is not.
(Dr. Öğr. Üyesi Deniz Dal)
Yapısal Programlama Yüksek Düzeyli Dillerin Gelişim Süreci
Güzel bir bahar gününün sabahında İETT şöförü garaja gider, otobüsünü çalıştırır ve yola çıkar. Sorunsuz bir şekilde bir duraktan diğerine ilerler, yolcularını.
Chapter 5 – Balancing of accounts
Imagine that you are a teacher and you are taking your 20 students to England for the summer school.
PREPARED BY: 9-B STUDENTS. Sumerians, who laid the foundations of great civilizations and the world cultural heritage, emerged to the st The Sumerians.
Bilgisayarlar kodu nasıl işler?
SUBJECT NAME Prepeared by Write the names of group members here
People with an entrepreneurial mindset are always brave.
TWINSPACE Anthony RIOU Coşku AKER TR Teacher Multilateral Contact Seminar, İ zmir, April 2019.
Sunum transkripti:

INTRODUCTION TO JAVASCRIPT

JAVASCRIPT ► JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more. ► JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Mozilla, Firefox, Netscape, Opera.

WHAT IS JAVASCRIPT? ► JavaScript was designed to add interactivity to HTML pages ► JavaScript is a scripting language (a scripting language is a lightweight programming language) ► A JavaScript consists of lines of executable computer code ► A JavaScript is usually embedded directly into HTML pages ► JavaScript is an interpreted language (means that scripts execute without preliminary compilation) ► Everyone can use JavaScript without purchasing a license

Are Java and JavaScript the Same? ► NO! ► Java and JavaScript are two completely different languages in both concept and design! ► Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++.

How to Put a JavaScript Into an HTML Page? <html><body> document.write("Hello World!") </script></body></html>

Ending Statements With a Semicolon? ► With traditional programming languages, like C++ and Java, each code statement has to end with a semicolon (;). ► Many programmers continue this habit when writing JavaScript, but in general, semicolons are optional! However, semicolons are required if you want to put more than one statement on a single line.

JavaScript Variables ► Variables are used to store data. ► A variable is a "container" for information you want to store. A variable's value can change during the script. You can refer to a variable by name to see its value or to change its value. ► Rules for variable names:  Variable names are case sensitive  They must begin with a letter or the underscore character ► strname – STRNAME (not same)

JavaScript Operators Arithmetic Operators (İşleçler, iki ya da daha fazla değer üzerinde işlem yapılmasını sağlar. JavaScript içinde aritmetik ve hesaplama işleçleri olmak üzere iki tür işleç kullanılır ) OperatorDescriptionExampleResult +Additionx=24 y=2 x+y -Subtractionx=53 y=2 x-y *Multiplicationx=520 y=4 x*y /Division15/53 5/22,5 %Modulus (division remainder) 5%21 10%82 10%20 ++Incrementx=5x=6 x++ --Decrementx=5x=4 x--

JavaScript Operators – 2 Assignment Operators (Atama deyimi (=), bir değişkene bir değerin atanmasını sağlar. Değişkenlere türlerine ve tanımlamalarına uygun olan herhangi bir değer atanabilir.) OperatorExampleIs The Same As =x=y +=x+=yx=x+y -=x-=yx=x-y *=x*=yx=x*y /=x/=yx=x/y %=x%=yx=x%y

JavaScript Operators - 3 Comparison Operators (Karşılaştırma işleci, iki ya da daha çok değeri birbiriyle karşılaştırarak True ya da False olarak mantıksal bir değer döndürür.) OperatorDescriptionExample ==is equal to5==8 returns false ===is equal to (checks for both value and type) x=5 y="5" x==y returns true x===y returns false !=is not equal5!=8 returns true >is greater than5>8 returns false <is less than5<8 returns true >=is greater than or equal to 5>=8 returns false <=is less than or equal to5<=8 returns true

JavaScript Operators - 4 Logical Operators (İkili işleçler birden çok karşılaştırma işlemini tek bir koşul ifadesi olarak birleştirirler.) OperatorDescriptionExample &&andx=6 y=3 (x 1) returns true ||orx=6 y=3 (x==5 || y==5) returns false !notx=6 y=3 !(x==y) returns true

JavaScript Basic Examples <script> document.write("Hello World!")  format text with HTML code - heading  format text with HTML code - heading<script> alert("Hello World!") </script>

Example <script> x=“Hello World!” document.write(x)</script><script> x=“İsminizi Yazın….” document.write(“Merhaba” +x)  use line break html code  use line break html code

JavaScript Popup Boxes ► Alert Box  An alert box is often used if you want to make sure information comes through to the user.  When an alert box pops up, the user will have to click "OK" to proceed. <script> alert("Hello World!") </script>

JavaScript Popup Boxes - 2 ► Confirm Box  A confirm box is often used if you want the user to verify or accept something.  When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.  If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

JavaScript Popup Boxes - 3 ► Prompt Box  A prompt box is often used if you want the user to input a value before entering a page.  When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value.  If the user clicks "OK“, the box returns the input value. If the user clicks "Cancel“, the box returns null.

Prompt Box Example <script> x=prompt (“Adınızı Yazınız”, “ ”) document.write(“Merhaba ”,+x) </script>

JS Examples -1 Y=20x+12 ve x=3 ise, sonucu açılan pencerede gösteren kod nasıl yazılmalıdır? <script>x=3y=20*x+12alert(y)</script>

Examples -2 <script>s1=12s2=28toplam=s1+s2 document.write("Sayıların toplamı: "+toplam) </script>

Examples -3 <script>s1=12s2=28toplam=s1+s2fark=s1-s2carp=s1*s2bol=s1/s2 document.write(" Değişkenlerdeki sayılarla ilgili aritmetik işlemler... ") document.write(" Sayıların toplamı: "+toplam) document.write(" Sayıların farkı: "+fark) document.write(" Sayıların çarpımı: "+carp) document.write(" 1.sayının 2.sayıya bölümü: "+bol) alert("Hesaplamalar sona erdi!") s1=12, s2=28 Bu değişkenlere ait sayıların toplamlarını, farklarını, çarpımlarını ve bölümlerini ayrı satırlarda gösteren ve son olarak ekrana “Hesaplamalar sona erdi” yazısını çıkaran js kodunu oluşturunuz.

Conditional Statements ► Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In JavaScript we have the following conditional statements: ► if statement - use this statement if you want to execute some code only if a specified condition is true ► if...else statement - use this statement if you want to execute some code if the condition is true and another code if the condition is false ► if...else if....else statement - use this statement if you want to select one of many blocks of code to be executed ► switch statement - use this statement if you want to select one of many blocks of code to be executed

Conditional Statements - 2 if (condition) { code to be executed if condition is true } if (condition) { code to be executed if condition is true }else{ code to be executed if condition is not true }

Conditional Statements Examples <script>x=3if(x<0){ alert (“negatif”) }else{ alert (“pozitif”) }</script>

Conditional Statements Examples - 2 <script> c=confirm(“Kitap Okuyor musunuz?”) if(c){ alert (“tebrikler walla”) }else{ alert (“ayıp ettiniz ama”) }</script>

Conditional Statements Examples - 3 <script> p=prompt("Ankara'nın plaka numarası nedir?", " ") if(p=="06"){alert("Doğru")}else{alert("Yanlış")}</script>