|
1 | | -# Developer konsolu |
| 1 | +# Tərtibatçı alətləri |
2 | 2 |
|
3 | | -Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are _absolutely_ going to make errors, at least if you're a human, not a [robot](<https://en.wikipedia.org/wiki/Bender_(Futurama)>). |
| 3 | +Yazdığımız kodlar həmişə xatalara meyillidir. Yəni, yəqin ki, arada bir iki səhv edəcəksiniz də... desəm düzgün olmaz, çünki siz **mütləq** səhv edəcəksiniz. Siz insansınız. |
4 | 4 |
|
5 | | -But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it. |
| 5 | +Lakin brauzer mühitində istidəçilər həmin xətaları görmürlər. Əgər yazdığınız skriptdə nə isə qaydasında deyilsə, siz onu görə bilməyəcəksiniz və bu səbəbdən də problemi həll etmək sizin üçün çətin olacaq. |
6 | 6 |
|
7 | | -To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers. |
| 7 | +Məhz bu səbəbdən, etdiyimiz xətaları görmək və yazdığımız skriptlər haqqında əlavə məlumat əldə etmək üçün brauzerlər "tərtibatçı alətləri" (developer tools) təqdim edir. |
8 | 8 |
|
9 | | -Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific. |
| 9 | +Bu cür alətlərin ən yaxşısı və seviləni Chrome və Firefoxda olduğu üçün, əksər proqramçılar məhz bu brauzerləri istifadə edir. Digər brauzerlər də bu kimi tərtibatçı alətləri təqdim etsələr də, Chrome və Firefox ilə demək olar ki, eyni şey olduğu üçün bu iki brauzer əksər proqramçıların sevimlisidir və sadəcə brauzer-spesifik problemlər yarandığı hallarda digər brauzerlərə keçid edirlər. |
10 | 10 |
|
11 | | -Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands. |
| 11 | +Tərtibatçı alətləri güclüdür və çoxlu sayda xüsusiyyətləri var. Başlanğıc üçün, gəlin onları açmağı, xətalara baxmağı və JavaScript komandalarını icra etməyi öyrənək. |
12 | 12 |
|
13 | 13 | ## Google Chrome |
14 | 14 |
|
15 | | -Open the page [bug.html](bug.html). |
| 15 | +[bug.html](bug.html) səhifəsini açın. |
16 | 16 |
|
17 | | -There's an error in the JavaScript code on it. It's hidden from a regular visitor's eyes, so let's open developer tools to see it. |
| 17 | +Bu səhifədə yazılmış JavaScript-də xəta var. Bu xəta normal istifadəçidən gizlədilmişdir, gəlin tərtibatçı alətlərini açaq və görək yazılmış kodda nə problem var. |
18 | 18 |
|
19 | | -Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`. |
| 19 | +Bunun üçün `key:F12` düyməsini basın. Əgər Mac istifadəçisinizsə o zaman `key:Cmd+Opt+J` kombinasiyasından istifadə edin. |
20 | 20 |
|
21 | | -The developer tools will open on the Console tab by default. |
| 21 | +Tərtibatçı alətləri açılacaq və orada çoxlu sayda tab görəcəksiniz. Defolt olaraq isə Console tabı açıq olacaq. |
22 | 22 |
|
23 | | -It looks somewhat like this: |
| 23 | +Təxmini belə bir şey: |
24 | 24 |
|
25 | 25 |  |
26 | 26 |
|
27 | | -The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar. |
| 27 | +Konsolun dəqiq görünüşü Chrome-un versiyasına görə dəyişə bilər lakin çox vaxt oxşardır. |
28 | 28 |
|
29 | | -- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command. |
30 | | -- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred. |
| 29 | +- Yəqin ki, konsoldakı qırmızı rəngli xəta mesajını görürsünüz. Bu halda, xəta bizə "lalala" deyə bir şeyin təyin olunmadığını deyir. |
| 30 | +- Sağ tərəfdə isə `bug.html:12` adlı keçid var. Bu keçid, bizə xətanın `bug.html` faylının `12`-ci sətrindən qaynaqlandığını göstərir. |
31 | 31 |
|
32 | | -Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them. |
| 32 | +Ondan aşağıda gördüyünüz `>` işarəsi isə komanda xəttidir (command line) . Siz burada JavaScript komandaları yaza və `key:Enter` basmaqla həmin komandaları icra edə bilərsiniz. |
33 | 33 |
|
34 | | -Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>. |
| 34 | +Artıq xətaları görə bildiyimizə görə hələ ki, bu bizim üçün kifayətdir. Sonrakı fəsillərdə debugging (bug-lardan təmizləmə) haqqında daha çox öyrənəcəyik. |
35 | 35 |
|
36 | | -```smart header="Multi-line input" |
37 | | -Usually, when we put a line of code into the console, and then press `key:Enter`, it executes. |
| 36 | +```smart header="Bir neçə sətirlik komandalar" |
| 37 | +Adətən komandanı daxil edib `key:Enter` basdıqdan sonra həmin komanda icra olunur. |
38 | 38 |
|
39 | | -To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code. |
| 39 | +Əgər bir neçə sətirlik kod yazırsınızsa, o zaman `key:Shift+Enter` basın. Bu vasitə ilə siz uzun JavaScript kodları yaza və icra edə bilərsiniz. |
40 | 40 | ``` |
41 | 41 |
|
42 | | -## Firefox, Edge, and others |
| 42 | +## Firefox, Edge və başqaları |
43 | 43 |
|
44 | | -Most other browsers use `key:F12` to open developer tools. |
| 44 | +Əksər brauzerlərdə alətləri açmaq üçün `key:F12` komandasından istifadə olunur. |
45 | 45 |
|
46 | | -The look & feel of them is quite similar. Once you know how to use one of these tools (you can start with Chrome), you can easily switch to another. |
| 46 | +Görünüş hamısında demək olar ki, eynidir. Birini istifadə etməyi tam öyrəndikdən sonra (misalçün Chrome ilə başlaya bilərsiniz) digərlərinə rahatlıqla keçid edə bilərsiniz. |
47 | 47 |
|
48 | 48 | ## Safari |
49 | 49 |
|
50 | | -Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first. |
| 50 | +Safaridə (Mac brauzerdiri, Windows/Linux əməliyyat sistemlərində dəstəklənmir) isə vəziyyət bir qədər fərqlidir. Əvvəlcə "Develop menu"-nu aktiv etməyimiz lazımdır. |
51 | 51 |
|
52 | | -Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom: |
| 52 | +Bunun üçün öncəliklər (Preferences) pəncərəsini açın və "Advanced" panelinə daxil olun. Orada aşağıdakı kimi bir checkbox görəcəksiniz: |
53 | 53 |
|
54 | 54 |  |
55 | 55 |
|
56 | | -Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options. |
| 56 | +İndi isə `key:Cmd+Opt+C` kombinasiyası ilə konsolu aça və bağlaya bilərsiniz. Nəzərinizə çatdıraq ki, yuxarı menyuda da "Develop" adlı yeni bir seçim yaranmışdır. |
57 | 57 |
|
58 | | -## Summary |
| 58 | +## Xülasə |
59 | 59 |
|
60 | | -- Developer tools allow us to see errors, run commands, examine variables, and much more. |
61 | | -- They can be opened with `key:F12` for most browsers on Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first). |
| 60 | +- Tərtibatçı alətləri bizə xətaları görmək, komandalar icra etmək, dəyişənləri təhlil etmək və s. bu kimi çoxlu sayda imkanlar yaradır. |
| 61 | +- `key:F12` komandası ilə onları aça və istifadə edə bilərsiniz. Chrome for Mac üçün `key:Cmd+Opt+J`, Safari üçün isə `key:Cmd+Opt+C` kombinasiyalarında istifadə edin (unutmayın ki, Safaridə əvvəlcə bunu aktivləşdirmək lazmdır). |
62 | 62 |
|
63 | | -Now we have the environment ready. In the next section, we'll get down to JavaScript. |
| 63 | +Mühit ilə bağlı hər şeyi yekunlaşdırdığımız üçün artıq JavaScript ilə yaxından tanış olmağa tam hazırıq. |
0 commit comments