Benzer belgeler
JAVASCRIPT JAVASCRIPT DİLİ

BBS 514 YAPISAL PROGRAMLAMA (STRUCTURED PROGRAMMING)

D-Link DSL 500G için ayarları

mikroc Dili ile Mikrodenetleyici Programlama Ders Notları

IDENTITY MANAGEMENT FOR EXTERNAL USERS

a, ı ı o, u u e, i i ö, ü ü

Virtualmin'e Yeni Web Sitesi Host Etmek - Domain Eklemek

IMDS KURULUM KILAVUZU (AIOS TEDARİKÇİLERİ İÇİN HAZIRLANMIŞTIR)

Öğr. Gör. Serkan AKSU 1

Cases in the Turkish Language

Java dili, aşağıdakiler de dahil olmak üzere çok çeşitli denetleyici türlerine sahiptir.

1 JAVASCRIPT NEDİR? 1

Javascript. 1) Notepad++ aşağıdaki kodları yazıp deneme.html olarak kaydedelim. 2) Biraz önceki sayfa sadece html kodların içeriyordu.

BBS515 Nesneye Yönelik Programlama. Ders 2 Zümra Kavafoğlu

CmpE 320 Spring 2008 Project #2 Evaluation Criteria

ÖRNEKTİR - SAMPLE. RCSummer Ön Kayıt Formu Örneği - Sample Pre-Registration Form

Yarışma Sınavı A ) 60 B ) 80 C ) 90 D ) 110 E ) 120. A ) 4(x + 2) B ) 2(x + 4) C ) 2 + ( x + 4) D ) 2 x + 4 E ) x + 4

Degişken Tanımlama Ve Operatörler

#include <stdio.h> int main(void) { FILE * dosya; dosya = fopen("soru1.txt", "w"); fprintf(dosya, "Merhaba Dunya!"); fclose(dosya); return 0; }

BMÜ-111 ALGORİTMA VE PROGRAMLAMA AKIŞ KONTROLÜ YRD. DOÇ. DR. İLHAN AYDIN


Present continous tense

İçerik. Java da İşleçler, İşleçler. Aritmetik İşleçler - 1. Aritmetik İşleçler - 2. Geçen ders: Bu ders: BS-515 Nesneye Yönelik Programlama

AB surecinde Turkiyede Ozel Guvenlik Hizmetleri Yapisi ve Uyum Sorunlari (Turkish Edition)

En kucuk calisabilir birime satetement denir Statements semicolon (;) ile sonlanir Yalniz basina ; null statement i ifade eder

Matematik Mühendisliği - Mesleki İngilizce

Java da İşleçler, Ders #3 (4 Kasım 2009)

Fen ve Mühendislik Uygulamaları ile MATLAB

Bölüm 6. Diziler (arrays) Temel kavramlar Tek boyutlu diziler Çok boyutlu diziler

BBS515 Nesneye Yönelik Programlama. Ders 3 Zümra Kavafoğlu

K12NET ÖĞRENCİ-VELİ PORTALI KULLANIMI USE OF K12NET STUDENT-PARENT PORTAL

Website review m.iyibahis.net

Exercise 2 Dialogue(Diyalog)

Note: If you want to validate a page containing frames, be sure the DTD is set to "Frameset DTD". Read more about XHTML Validation.

Week 5 Examples and Analysis of Algorithms

8- Sistem tarihinden gün değerini alarak çift veya tek sayı olup arasındaki sayılardan tek olanları yeşil çift olanları kırmızı

HTML 4. Bölüm. Doç. Dr. İsmail Rakıp Karaş Dersin Course Page:

Bölüm 3. Akış denetimi (flow of control)

Teknoloji Servisleri; (Technology Services)

econn (Supplier Portal) of the MANN+HUMMEL Group

İnternet Programcılığı Dersi 2.Dönem Ders Notu

#include <stdio.h> int main(void) { float sayi; float * p; p = &sayi; printf("deger girin:"); scanf("%f", p); printf("girilen deger:%f\n", *p);

CNC MACH breakout board user manual V8 type

HOW TO MAKE A SNAPSHOT Snapshot Nasil Yapilir. JEFF GOERTZEN / Art director, USA TODAY

Mart 31, Google News Kaydı. by

Get started with Google Drive

Argumentative Essay Nasıl Yazılır?

BTP 207 İNTERNET PROGRAMCILIĞI I. Ders 8

HTML. Doç. Dr. İsmail Rakıp Karaş Dersin Course Page: 2. Bölüm

Upgrading Internet Technology skills of Information and Communication Technologies (ICT) Professionals

INTERSHIP DIARY GUIDELINE/ STAJ DEFTERİ HAZIRLAMA REHBERİ

ATILIM UNIVERSITY Department of Computer Engineering

Python ile Programlamaya Giriş DERS 6: DÖNGÜLER DR. HÜSEYİN BAHTİYAR

About QDenetim and QDestek (Sistem Danışmanlık)

Javascript Ders Örnekleri -2. Tarayıcı Görüntüsü

C++ Statements. { ve } arasında ifade edilen bir dizi statement bir compound statement (birleşik ifade) oluşturur.

Mart Ayı Değerler Eğitimi. Samimiyet

Maltepe Üniversitesi Bilgisayar Mühendisliği Bölümü BİL 203 Veri Yapıları ve Algoritmalar I

OPERATÖRLER Alıştırmalar

Kontrol Yapıları (2)

Do not open the exam until you are told that you may begin.

Bilgisayar Programlama

a, ı ı o, u u e, i i ö, ü ü şu that (something relatively nearby) şu ekmek o that (something further away) o dondurma

BTP 207 İNTERNET PROGRAMCILIĞI I. Ders 9

1. PL/SQL de kontrol yapıları

Unlike analytical solutions, numerical methods have an error range. In addition to this

FINITE AUTOMATA. Mart 2006 Ankara Üniversitesi Bilgisayar Mühendisliği 1

DOS KOMUTLARI (DOS COMMANDS)

Mühendislik Fakültesi Elektrik-Elektronik Mühendisliği C Programlama 5. Bölüm Karar ve Çevrim Kontrol Yapıları

BAŞVURU ŞİFRE EDİNME EKRANI/APPLICATION PASSWORD ACQUISITION SCREEN

WEB PROGRAMLAMA. DERS NOTLARI / JavaScript e Giriş YARD. DOÇ. DR. MEHTAP YALÇINKAYA

Kullanıcı Dökümanı. Flash B2B. Versiyon 0.1

.. ÜNİVERSİTESİ UNIVERSITY ÖĞRENCİ NİHAİ RAPORU STUDENT FINAL REPORT


PostgreSQL ve PL/pgSQL

Konforun Üç Bilinmeyenli Denklemi 2016

BBM Discrete Structures: Final Exam Date: , Time: 15:00-17:00

BETİK DİLİ / JAVASCRIPT. Web Tasarımı ve Programlama

Yaz okulunda (2014 3) açılacak olan (Calculus of Fun. of Sev. Var.) dersine kayıtlar aşağıdaki kurallara göre yapılacaktır:

Dersin Türü (Course Type) Zorunlu (Compulsory)[Χ] Seçmeli (Elective) [ ]

BİLGİSAYAR PROGRAMLAMAYA GİRİŞ

Java da Program Denetimi ve Operatörler

SPSS (Statistical Package for Social Sciences)

Corporate Design Manual bio.inspecta Ltd. bio.inspecta Ltd. Kurumsal Tasarım El Kitabı

BİLGİSAYAR TEMELLERİ VE PROGRAMLAMAYA GİRİŞ

C++ Operatörler (Operators)

PROGRAMLAMAYA GİRİŞ DERS 2

Görsel Programlama DERS 03. Görsel Programlama - Ders03/ 1

KONTROL YAPILARI JAVADA UC TURLU KONTROL YAPISI VARDIR BUNLAR İF ELSE İF ELSE İF SWİTCH YAPILARIDIR. IF ELSE YAPISI if (deger) { }else {

Programlamaya Giriş Karar Yapıları, Tekrarlı İfadeler(Döngüler)

3. KOŞUL YAPILARI 3.1. IF YAPISI 2

WEEK 11 CME323 NUMERIC ANALYSIS. Lect. Yasin ORTAKCI.

WILLIAM SHAKESPEARE BY TERRY EAGLETON DOWNLOAD EBOOK : WILLIAM SHAKESPEARE BY TERRY EAGLETON PDF

MM103 E COMPUTER AIDED ENGINEERING DRAWING I

ALGORİTMA VE PROGRAMLAMA I

BLG4134 Görsel Programlama III. Öğr. Grv. Aybike ŞİMŞEK

KIMSE KIZMASIN KENDIMI YAZDIM BY HASAN CEMAL

Fortran da kullanılan giriş çıkış komutları PRINT, WRITE ve READ dir.

SAYI SİSTEMLERİ. 1. Sayı Sistemleri. Sayı Sistemlerinde Rakamlar

Veri Tabanı Yönetim Sistemleri Bölüm - 5

Transkript:

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> <body> HTML Page? <script type="text/javascript"> 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) Operator Description Example Result + Addition x=2 4 y=2 x+y - Subtraction x=5 3 y=2 x-y * Multiplication x=5 20 y=4 x*y / Division 15/5 3 % Modulus (division remainder) 5/2 2,5 5%2 1 10%8 2 10%2 0 ++ Increment x=5 x=6 x++ -- Decrement x=5 x=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.) Operator Example Is The Same As = x=y x=y += x+=y x=x+y -= x-=y x=x-y *= x*=y x=x*y /= x/=y x=x/y %= x%=y x=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.) Operator Description Example == is equal to 5==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 equal 5!=8 returns true > is greater than 5>8 returns false < is less than 5<8 returns true >= is greater than or equal to 5>=8 returns false <= is less than or equal to 5<=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.) Operator Description Example && and x=6 y=3 (x < 10 && y > 1) returns true or x=6 y=3! not x=6 (x==5 y==5) returns false y=3!(x==y) returns true

JavaScript Basic Examples <script> document.write("hello World!") </script> 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) </script> 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 <br>,+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=3 y=20*x+12 alert(y) </script>

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

s1=12, s2=28 Examples -3 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. <script> s1=12 s2=28 toplam=s1+s2 fark=s1-s2s2 carp=s1*s2 bol=s1/s2 document.write("<br>değişkenlerdeki sayılarla ilgili aritmetik işlemler...<br>") document.write("<br>sayıların toplamı: "+toplam) document.write("<br>sayıların farkı: "+fark) document.write("<br>sayıların çarpımı: "+carp) document.write("<br>1.sayının 2.sayıya bölümü: "+bol) alert("hesaplamalar sona erdi!") </script >

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=3 if(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>