SlideShare a Scribd company logo
1 of 12
Download to read offline
+JAVASCRIPT-icindekiler     7/30/09   9:34 PM      Page vii




             ‹Ç‹NDEK‹LER
          1 JAVASCRIPT’E G‹R‹fi                                          1
             Javascript Kodlar›n› HTML Sayfas› ‹çerisine Eklemek        3
             Kodlar Aras›na Aç›klama Sat›rlar› Eklemek                  6
             Kodlar›m›z› Eski Sürüm Taray›c›lardan Saklama              7
             Sayfa Aç›l›fl›nda Javascript Kodlar›n›n Çal›flt›r›lmas›      8
          2 JAVASCRIPT TEMELLER‹                                        9
             De¤iflkenler                                                9
                De¤iflken Tan›mlarken Dikkat Etmeniz Gereken Kurallar   10
                De¤iflkenlere De¤er Atamak                              11
             Veri Türleri                                              11
                number                                                 12
                boolean                                                12
                string                                                 12
                Diziler (Array)                                        13
                undefined                                              13
                null                                                   14
             Veri Türü Dönüflümleri                                     15
          3 OPERATÖRLER                                                17
             Atama Operatörleri                                        17
             Aritmetiksel ‹fllemler ve String (+)                       18
             De¤er Artt›rma ve Azaltma Operatörleri                    19
             Karfl›laflt›rma Operatörleri                                20
             Mant›ksal Operatörler                                     21
             Typeof Operatörü                                          22
             fiarta Ba¤l› Komut Çal›flt›rma (Ternary Operatörü)          22
             ‹fllem Önceli¤i                                            23
             Javascript ile Sayfaya HTML ‹çeri¤i Yazmak                24
                ‹ki Metin Aras›nda Boflluk B›rakma ve
                Sayfa Ak›fl›n› Bir Alt Sat›ra ‹ndirme, Tafl›ma           26
+JAVASCRIPT-icindekiler      7/30/09   9:34 PM    Page viii




        viii JAVASCRIPT

                <body> Etiketleri ‹çerisine Javascipt Kodu Yazma                  27
                <Head> Etiketleri Aras›na ve <Body> Etiketleri ‹çinde Farkl›
                Bölgelere Javascript Kodu Yazma                                   28
             Karakter Katarlar›n›n Biçimlerini De¤ifltirme (String Metodlar›)      29
                sub()                                                             29
                sup()                                                             29
                bold()                                                            30
                italics()                                                         30
                toLowerCase()                                                     30
                toUpperCase()                                                     30
                fontcolor()                                                       30
                fontsize()                                                        31
                strike(                                                           31
                charAt()                                                          31
                charCodeAt()                                                      31
                concat()                                                          32
                replace()                                                         32
                match()                                                           32
                slice()                                                           32
                indexof()                                                         33
                substring()                                                       33
                    substring (baslangic,bitis)                                   33
                    substring (baslangic)                                         33
                substr ()                                                         33
          4 D‹Z‹LER (ARRAY)                                                       35
             Dizi De¤iflkenine Eleman (De¤er) Girme                                36
             Dizi Tan›mlarken Boyutunu Belirleme                                  37
             Dizi De¤iflkenleri ‹çindeki Elemanlara Ulaflma ve Elemanlar› De¤ifltirme 38
             Dizi De¤iflkenlerine Eleman Eklemek, Silmek                           40
                ‹ndeks Numaras› ile Diziye Eleman Eklemek                         40
                push()                                                            40
                unshift( )                                                        41
+JAVASCRIPT-icindekiler     7/30/09   9:34 PM   Page ix




                                                                        ‹Ç‹NDEK‹LER ix

                splice( )                                                        42
             Dizi Eleman›n› Silmek (Dizi ‹çinden Koparmak)                        42
             Diziye Eleman Eklemek                                               43
             Ayn› Anda Diziden Eleman Silmek ve Eklemek                           43
                concat( )                                                        45
                pop( )                                                           46
                shift( )                                                         46
                delete Operatörü                                                 47
             Dizi De¤iflkenleri ‹çerisindeki Elemanlar› S›ralamak ‹çin
             Kullan›lan Metodlar                                                 48
                sort( )                                                          48
                reverse ( )                                                      51
             Dizi De¤iflkenleri ‹çerisinde Eleman Aramak ‹çin
             Kullan›lan Metodlar                                                 51
                indexOf ( ), lastindexOf                                         51
             Dizi De¤iflkenlerin ‹çindeki Nesnelerin Metinsel Veriye
             Dönüflümü ile ‹lgili Metodlar                                         52
                toString(), join()                                               52
             Çok Boyutlu Diziler                                                 53
          5 KOfiUL ‹FADELER‹ VE DÖNGÜLER                                           55
             Koflul ‹fadeleri                                                     55
                if ‹fadesi                                                       55
                if else Yap›s›                                                   56
                else if Yap›s›                                                   57
                switch ‹fadesi (Durum-Koflul)                                     59
             Döngü ‹fadeleri                                                     61
                for Döngüsü                                                      61
                while Döngüsü                                                    64
                do..while Döngüsü                                                66
             Döngülerde Kullan›lan Deyimler                                      67
                break Deyimi                                                     67
                continue Deyimi                                                  68
+JAVASCRIPT-icindekiler   7/30/09     9:34 PM   Page x




         x JAVASCRIPT

          6 FONKS‹YONLAR                                  71
             Fonksiyon Tan›mlama                          72
             Fonksiyonlarda Geriye De¤er Döndürme         77
             Rekursive Fonksiyonlar                       80
             Haz›r Fonksiyonlar                           81
                eval()                                   81
                isFinite()                               83
                isNaN( )                                 83
                escape ( ) ve unescape( )                83
                parseint( ) ve parseFloat( )             84
                String( ) ve Number( )                   85
             De¤iflkenlerin Geçerli Olduklar› Alan        86
          7 OLAYLAR (EVENTS)                              89
             Eventhandler (Olay Yönlendiricileri)         89
                onLoad, onUnLoad Olaylar›                 90
                onClick, onDbClik Olaylar›                92
                onSubmit Olay›                            94
                onReset Olay›                             95
                onChange Olay›                            96
                onFocus Olay›                             98
                onBlur Olay›                              99
                onError, onAbort Olaylar›                100
                onSelect Olay›                           102
                onResize Olay›                           103
                onKeyDown Olay›                          103
                onKeyPress Olay›                         107
                onKeyUp Olay›                            108
                onMouseDown Olay›                        109
                onMousemove Olay›                        109
                onMouseout Olay›                         109
                onMouseOver Olay›                        109
                onMouseUp Olay›                          109
+JAVASCRIPT-icindekiler     7/30/09      9:34 PM   Page xi




                                                                  ‹Ç‹NDEK‹LER xi

          8 HATA DENET‹M‹                                                 113
             try-catch Hata Yakalama Bloklar›                             113
             try-catch -finally Yap›s›                                    115
             throw                                                        116
          9 JAVASCRIPT NESNELER‹                                          119
             Javascript Nesnesi Yaratmak                                  120
             Nesne (Object) Yaratmak                                      120
             Oluflturdu¤umuz Nesnelere Özellik Eklemek                     121
             Oluflturdu¤umuz Nesnelere Metod (Fonksiyon) Eklemek           123
             Javascript Haz›r Nesneler                                    125
                String Nesnesi                                            125
                   String Nesnesinin Metodlar›                            125
                Array Nesnesi                                             126
                Boolean Nesnesi                                           126
                   Boolean Nesnesi Özellikleri                            126
                   Boolean Nesnesi Metodlar›                              127
                Date Nesnesi                                              127
                   Date Nesnesinin Önemli Metodlar›                       127
                Number Nesnesi                                            134
                     Number Nesnesi Özellikleri                           134
                  Number Nesnesi Metodlar›                                135
                Math Nesnesi                                              136
                     Math Nesnesi Metodlar›                               136
          10 DÜZENL‹ ‹FADELER (RegExp NESNES‹)                            145
             RegExp Nesnesi Olufltural›m                                   146
                g-(global)                                                146
                    i-(ignoreCase)                                        147
                m-(multiline)                                             147
             Nesne Özellikleri                                            147
                global                                                    147
                ignoreCase                                                148
                multiline                                                 148
+JAVASCRIPT-icindekiler     7/30/09   9:34 PM   Page xii




        xii JAVASCRIPT

                input                                                 148
                lastindex                                             149
                lastMatch                                             150
                leftContext                                           150
                rightContext                                          151
             Nesne Metodlar›                                          152
                compile ()                                            152
                exec ()                                               152
                test()                                                153
                search ()                                             155
                match ()                                              155
                replace()                                             156
                split()                                               156
             Düzenli ‹fade Olufltururken Kullan›lan Özel Karakterler   157
                Konum Belirleyen Karakterler                          157
                    ^ Karakteri                                       157
                    $ Karakteri                                       157
                    b Karakteri                                      158
                    B Karakteri                                      158
                    ?= Karakteri                                      159
                    ?! Karakteri                                      160
                Gözükmeyen Karakterleri Düzenli
                ‹fade ‹çinde Temsil Eden Karakterler                  160
                Di¤er Özel Karakterler                                161
                Tekrarlama Miktarlar›n› Ayarlayan Karakterler         164
                Grup Oluflturma ve Grup ‹çi Karakterler                166
                e-mail Do¤rulama ‹fllemleri                            167
                Tarih Do¤rulama ‹fllemleri                             170
          11 TARAYICI NESNELER‹                                       177
             window Nesnesi                                           177
                Nesne Özellikleri                                     177
                    defaultStatus                                     177
+JAVASCRIPT-icindekiler      7/30/09   9:34 PM   Page xiii




                                                             ‹Ç‹NDEK‹LER xiii

                   name                                               181
                   outerHeight, outerWidth                            181
                   closed                                             181
                Nesne Metodlar›                                       181
                   Open ( )                                           181
                   URL                                                181
                   NAME                                               181
                   close ( )                                          185
                   focus ( )                                          189
                   blur( )                                            189
                   alert( )                                           191
                   prompt( )                                          192
                   Confirm(                                           193
                   resizeBy( )                                        194
                   resizeTo( )                                        194
                   moveBy( )                                          195
                   moveTo( )                                          196
                   ScrollBy( )                                        197
                   ScrollTo( )                                        198
             navigator Nesnesi                                        198
                Nesne Özellikleri                                     198
                   appCodeName                                        198
                   appName                                            198
                   appVersion                                         198
                   browserLanguage                                    199
                   cookieEnabled                                      199
             3. screen Nesnesi                                        200
                Nesne Özellikleri                                     200
                   availHeight                                        200
                   availWidth                                         200
                   Height                                             200
                   Width                                              201
+JAVASCRIPT-icindekiler   7/30/09   9:34 PM   Page xiv




        xiv JAVASCRIPT

                    colorDepth                           201
             history Nesnesi                             202
                 Nesne Özellikleri                       202
                    length                               202
                 Nesne Metodlar›                         202
                    back()                               202
                    forward()                            202
                    go()                                 203
             location Nesnesi                            204
                 Nesne Özellikleri                       205
                    hash                                 205
                    href                                 207
                    search                               208
                    protocol                             208
                    pathname                             209
                 Nesne Metodlar›                         210
                    assign( )                            210
                    reload( )                            210
                    replace( )                           211
             document Nesnesi                            211
                 Nesne Özellikleri                       211
                    anchors[]                            211
                    links[]                              212
                    body                                 213
                    title                                215
                 Nesne Metodlar›                         216
                    getElementById()                     216
                    getElementByName()                   217
                    getElementByTagName()                219
                    write(), wr›teln()                   221
             Event Nesnesi                               221
                 Nesne Özellikleri                       221
                    altKey Özelli¤i                      221
+JAVASCRIPT-icindekiler   7/30/09    9:34 PM       Page xv




                                                                    ‹Ç‹NDEK‹LER xv

                    ctrlKey Özelli¤i                                        223
                    shiftKey Özelli¤i                                       224
                    keyCode Özelli¤i                                        225
                    Button Özelli¤i                                         228
                    screenX, screenY Özellikleri                            230
                    clientX, clientY Özellikleri                            231
          12 ZAMANLAYICILAR                                                 233
             Javascript’te Zamanlay›c›lar                                   233
                setTimeout()                                                233
                clearTimeout()                                              236
                setinterval()                                               238
                clearinterval()                                             240

          13 FORMLAR                                                        245
             <form> Nesnesi                                                 246
                method                                                      246
                elements[]                                                  247
                Form Nesnesi Metodlar›                                      249
                   submit()                                                 249
                   reset()                                                  251
             <INPUT> Nesnesi                                                252
                Form Elemanlar› (Nesneleri) ‹çin Ortak Özellikler           253
                   type                                                     253
                   ›d                                                       253
                   name                                                     253
                   disabled                                                 254
                   accesskey                                                255
                   tabindexS                                                257
             Form Elemanlar› (Nesneleri)                                    257
                text (Metin Kutusu) Nesnesi                                 257
                   value Özelli¤i                                           257
                text Nesnesi Özellikleri                                    258
                   size Özelli¤i                                            258
+JAVASCRIPT-icindekiler   7/30/09   9:34 PM   Page xvi




        xvi JAVASCRIPT

                     maxLength Özelli¤i                   259
                     readOnly Özelli¤i                    260
                text Nesnesi Metodlar›                    262
                     blur()                               262
                     focus()                              262
                     select()                             262
                password (fiifre Metin Kutusu) Nesnesi     263
                checkbox (Onay Kutusu) Nesnesi            264
                     checked Özelli¤i                     264
                     value Özelli¤i                       266
                checkbox Nesnesi Metodlar›                266
                     blur()                               266
                     focus()                              266
                     click()                              266
                radio (Seçenek Dü¤mesi) Nesnesi           268
                     checked Özelli¤i                     268
                     value Özelli¤i                       272
                hidden (Gizlenmifl Form Eleman›) Nesnesi   272
                file Nesnesi                              273
                image Nesnesi                             273
                submit Nesnesi                            273
                reset Nesnesi                             274
                button Nesnesi                            274
                textarea Nesnesi                          276
                textarea Nesnesi Metodlar›                281
                     blur()                               281
                     focus()                              281
                     select()                             281
                select Nesnesi                            281
                Option Nesnesi                            282
                     options[]                            282
                Select Nesnesi Metodlar›                  287
                     add()                                287
                     remove()                             287
+JAVASCRIPT-icindekiler   7/30/09   9:34 PM       Page xvii




                                                              ‹Ç‹NDEK‹LER xvii

          14 ÇERÇEVELER                                                291
             frameset Nesnesi                                          291
                frameset Nesnesinin Özellikleri                        292
                    id                                                 292
                    cols                                               292
                    rows                                               294
                    frameborder                                        296
                    border                                             296
                    bordercolor                                        296
             frame Nesnesi                                             297
             noframes Etiketi                                          301
             iframe Nesnesi                                            302
          15 ÇEREZLER                                                  307
             Çerez Oluflturma                                           307
             Çerezi Okumak                                             309
+JAVASCRIPT-icindekiler   7/30/09   9:34 PM   Page xviii




       xviii JAVASCRIPT

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

+Javascript Icindekiler

  • 1. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page vii ‹Ç‹NDEK‹LER 1 JAVASCRIPT’E G‹R‹fi 1 Javascript Kodlar›n› HTML Sayfas› ‹çerisine Eklemek 3 Kodlar Aras›na Aç›klama Sat›rlar› Eklemek 6 Kodlar›m›z› Eski Sürüm Taray›c›lardan Saklama 7 Sayfa Aç›l›fl›nda Javascript Kodlar›n›n Çal›flt›r›lmas› 8 2 JAVASCRIPT TEMELLER‹ 9 De¤iflkenler 9 De¤iflken Tan›mlarken Dikkat Etmeniz Gereken Kurallar 10 De¤iflkenlere De¤er Atamak 11 Veri Türleri 11 number 12 boolean 12 string 12 Diziler (Array) 13 undefined 13 null 14 Veri Türü Dönüflümleri 15 3 OPERATÖRLER 17 Atama Operatörleri 17 Aritmetiksel ‹fllemler ve String (+) 18 De¤er Artt›rma ve Azaltma Operatörleri 19 Karfl›laflt›rma Operatörleri 20 Mant›ksal Operatörler 21 Typeof Operatörü 22 fiarta Ba¤l› Komut Çal›flt›rma (Ternary Operatörü) 22 ‹fllem Önceli¤i 23 Javascript ile Sayfaya HTML ‹çeri¤i Yazmak 24 ‹ki Metin Aras›nda Boflluk B›rakma ve Sayfa Ak›fl›n› Bir Alt Sat›ra ‹ndirme, Tafl›ma 26
  • 2. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page viii viii JAVASCRIPT <body> Etiketleri ‹çerisine Javascipt Kodu Yazma 27 <Head> Etiketleri Aras›na ve <Body> Etiketleri ‹çinde Farkl› Bölgelere Javascript Kodu Yazma 28 Karakter Katarlar›n›n Biçimlerini De¤ifltirme (String Metodlar›) 29 sub() 29 sup() 29 bold() 30 italics() 30 toLowerCase() 30 toUpperCase() 30 fontcolor() 30 fontsize() 31 strike( 31 charAt() 31 charCodeAt() 31 concat() 32 replace() 32 match() 32 slice() 32 indexof() 33 substring() 33 substring (baslangic,bitis) 33 substring (baslangic) 33 substr () 33 4 D‹Z‹LER (ARRAY) 35 Dizi De¤iflkenine Eleman (De¤er) Girme 36 Dizi Tan›mlarken Boyutunu Belirleme 37 Dizi De¤iflkenleri ‹çindeki Elemanlara Ulaflma ve Elemanlar› De¤ifltirme 38 Dizi De¤iflkenlerine Eleman Eklemek, Silmek 40 ‹ndeks Numaras› ile Diziye Eleman Eklemek 40 push() 40 unshift( ) 41
  • 3. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page ix ‹Ç‹NDEK‹LER ix splice( ) 42 Dizi Eleman›n› Silmek (Dizi ‹çinden Koparmak) 42 Diziye Eleman Eklemek 43 Ayn› Anda Diziden Eleman Silmek ve Eklemek 43 concat( ) 45 pop( ) 46 shift( ) 46 delete Operatörü 47 Dizi De¤iflkenleri ‹çerisindeki Elemanlar› S›ralamak ‹çin Kullan›lan Metodlar 48 sort( ) 48 reverse ( ) 51 Dizi De¤iflkenleri ‹çerisinde Eleman Aramak ‹çin Kullan›lan Metodlar 51 indexOf ( ), lastindexOf 51 Dizi De¤iflkenlerin ‹çindeki Nesnelerin Metinsel Veriye Dönüflümü ile ‹lgili Metodlar 52 toString(), join() 52 Çok Boyutlu Diziler 53 5 KOfiUL ‹FADELER‹ VE DÖNGÜLER 55 Koflul ‹fadeleri 55 if ‹fadesi 55 if else Yap›s› 56 else if Yap›s› 57 switch ‹fadesi (Durum-Koflul) 59 Döngü ‹fadeleri 61 for Döngüsü 61 while Döngüsü 64 do..while Döngüsü 66 Döngülerde Kullan›lan Deyimler 67 break Deyimi 67 continue Deyimi 68
  • 4. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page x x JAVASCRIPT 6 FONKS‹YONLAR 71 Fonksiyon Tan›mlama 72 Fonksiyonlarda Geriye De¤er Döndürme 77 Rekursive Fonksiyonlar 80 Haz›r Fonksiyonlar 81 eval() 81 isFinite() 83 isNaN( ) 83 escape ( ) ve unescape( ) 83 parseint( ) ve parseFloat( ) 84 String( ) ve Number( ) 85 De¤iflkenlerin Geçerli Olduklar› Alan 86 7 OLAYLAR (EVENTS) 89 Eventhandler (Olay Yönlendiricileri) 89 onLoad, onUnLoad Olaylar› 90 onClick, onDbClik Olaylar› 92 onSubmit Olay› 94 onReset Olay› 95 onChange Olay› 96 onFocus Olay› 98 onBlur Olay› 99 onError, onAbort Olaylar› 100 onSelect Olay› 102 onResize Olay› 103 onKeyDown Olay› 103 onKeyPress Olay› 107 onKeyUp Olay› 108 onMouseDown Olay› 109 onMousemove Olay› 109 onMouseout Olay› 109 onMouseOver Olay› 109 onMouseUp Olay› 109
  • 5. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xi ‹Ç‹NDEK‹LER xi 8 HATA DENET‹M‹ 113 try-catch Hata Yakalama Bloklar› 113 try-catch -finally Yap›s› 115 throw 116 9 JAVASCRIPT NESNELER‹ 119 Javascript Nesnesi Yaratmak 120 Nesne (Object) Yaratmak 120 Oluflturdu¤umuz Nesnelere Özellik Eklemek 121 Oluflturdu¤umuz Nesnelere Metod (Fonksiyon) Eklemek 123 Javascript Haz›r Nesneler 125 String Nesnesi 125 String Nesnesinin Metodlar› 125 Array Nesnesi 126 Boolean Nesnesi 126 Boolean Nesnesi Özellikleri 126 Boolean Nesnesi Metodlar› 127 Date Nesnesi 127 Date Nesnesinin Önemli Metodlar› 127 Number Nesnesi 134 Number Nesnesi Özellikleri 134 Number Nesnesi Metodlar› 135 Math Nesnesi 136 Math Nesnesi Metodlar› 136 10 DÜZENL‹ ‹FADELER (RegExp NESNES‹) 145 RegExp Nesnesi Olufltural›m 146 g-(global) 146 i-(ignoreCase) 147 m-(multiline) 147 Nesne Özellikleri 147 global 147 ignoreCase 148 multiline 148
  • 6. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xii xii JAVASCRIPT input 148 lastindex 149 lastMatch 150 leftContext 150 rightContext 151 Nesne Metodlar› 152 compile () 152 exec () 152 test() 153 search () 155 match () 155 replace() 156 split() 156 Düzenli ‹fade Olufltururken Kullan›lan Özel Karakterler 157 Konum Belirleyen Karakterler 157 ^ Karakteri 157 $ Karakteri 157 b Karakteri 158 B Karakteri 158 ?= Karakteri 159 ?! Karakteri 160 Gözükmeyen Karakterleri Düzenli ‹fade ‹çinde Temsil Eden Karakterler 160 Di¤er Özel Karakterler 161 Tekrarlama Miktarlar›n› Ayarlayan Karakterler 164 Grup Oluflturma ve Grup ‹çi Karakterler 166 e-mail Do¤rulama ‹fllemleri 167 Tarih Do¤rulama ‹fllemleri 170 11 TARAYICI NESNELER‹ 177 window Nesnesi 177 Nesne Özellikleri 177 defaultStatus 177
  • 7. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xiii ‹Ç‹NDEK‹LER xiii name 181 outerHeight, outerWidth 181 closed 181 Nesne Metodlar› 181 Open ( ) 181 URL 181 NAME 181 close ( ) 185 focus ( ) 189 blur( ) 189 alert( ) 191 prompt( ) 192 Confirm( 193 resizeBy( ) 194 resizeTo( ) 194 moveBy( ) 195 moveTo( ) 196 ScrollBy( ) 197 ScrollTo( ) 198 navigator Nesnesi 198 Nesne Özellikleri 198 appCodeName 198 appName 198 appVersion 198 browserLanguage 199 cookieEnabled 199 3. screen Nesnesi 200 Nesne Özellikleri 200 availHeight 200 availWidth 200 Height 200 Width 201
  • 8. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xiv xiv JAVASCRIPT colorDepth 201 history Nesnesi 202 Nesne Özellikleri 202 length 202 Nesne Metodlar› 202 back() 202 forward() 202 go() 203 location Nesnesi 204 Nesne Özellikleri 205 hash 205 href 207 search 208 protocol 208 pathname 209 Nesne Metodlar› 210 assign( ) 210 reload( ) 210 replace( ) 211 document Nesnesi 211 Nesne Özellikleri 211 anchors[] 211 links[] 212 body 213 title 215 Nesne Metodlar› 216 getElementById() 216 getElementByName() 217 getElementByTagName() 219 write(), wr›teln() 221 Event Nesnesi 221 Nesne Özellikleri 221 altKey Özelli¤i 221
  • 9. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xv ‹Ç‹NDEK‹LER xv ctrlKey Özelli¤i 223 shiftKey Özelli¤i 224 keyCode Özelli¤i 225 Button Özelli¤i 228 screenX, screenY Özellikleri 230 clientX, clientY Özellikleri 231 12 ZAMANLAYICILAR 233 Javascript’te Zamanlay›c›lar 233 setTimeout() 233 clearTimeout() 236 setinterval() 238 clearinterval() 240 13 FORMLAR 245 <form> Nesnesi 246 method 246 elements[] 247 Form Nesnesi Metodlar› 249 submit() 249 reset() 251 <INPUT> Nesnesi 252 Form Elemanlar› (Nesneleri) ‹çin Ortak Özellikler 253 type 253 ›d 253 name 253 disabled 254 accesskey 255 tabindexS 257 Form Elemanlar› (Nesneleri) 257 text (Metin Kutusu) Nesnesi 257 value Özelli¤i 257 text Nesnesi Özellikleri 258 size Özelli¤i 258
  • 10. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xvi xvi JAVASCRIPT maxLength Özelli¤i 259 readOnly Özelli¤i 260 text Nesnesi Metodlar› 262 blur() 262 focus() 262 select() 262 password (fiifre Metin Kutusu) Nesnesi 263 checkbox (Onay Kutusu) Nesnesi 264 checked Özelli¤i 264 value Özelli¤i 266 checkbox Nesnesi Metodlar› 266 blur() 266 focus() 266 click() 266 radio (Seçenek Dü¤mesi) Nesnesi 268 checked Özelli¤i 268 value Özelli¤i 272 hidden (Gizlenmifl Form Eleman›) Nesnesi 272 file Nesnesi 273 image Nesnesi 273 submit Nesnesi 273 reset Nesnesi 274 button Nesnesi 274 textarea Nesnesi 276 textarea Nesnesi Metodlar› 281 blur() 281 focus() 281 select() 281 select Nesnesi 281 Option Nesnesi 282 options[] 282 Select Nesnesi Metodlar› 287 add() 287 remove() 287
  • 11. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xvii ‹Ç‹NDEK‹LER xvii 14 ÇERÇEVELER 291 frameset Nesnesi 291 frameset Nesnesinin Özellikleri 292 id 292 cols 292 rows 294 frameborder 296 border 296 bordercolor 296 frame Nesnesi 297 noframes Etiketi 301 iframe Nesnesi 302 15 ÇEREZLER 307 Çerez Oluflturma 307 Çerezi Okumak 309
  • 12. +JAVASCRIPT-icindekiler 7/30/09 9:34 PM Page xviii xviii JAVASCRIPT