You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the picture above, you can click on element nodes and their children will open/collapse.
44
+
Yukarıdaki resimde, eleman düğümlerine tıklayabilirsiniz ve çocukları açılacak / daralacaktır..
45
45
```
46
46
47
-
Tags are called *element nodes* (or just elements). Nested tags become children of the enclosing ones. As a result we have a tree of elements: `<html>`is at the root, then`<head>`and`<body>`are its children, etc.
47
+
Etiketler *eleman düğümleri* veya sadece eleman olarak adlandırılır. İç içe geçmiş etiketler, çevreleyenlerin alt öğeleri olur. Sonuç olarak bir element ağacımız var: `<html>`burada köktür, sonra`<head>`ve`<body>`gelir bunlar ise html'nin çocuklarıdır vb.
48
48
49
-
The text inside elements forms *text nodes*, labelled as `#text`. A text node contains only a string. It may not have children and is always a leaf of the tree.
49
+
Öğelerin içindeki metin, `#text` olarak etiketlenmiş metin düğümleri oluşturur. Bir metin düğümü yalnızca bir dize içerir. Alt öğeleri olmayabilir ve her zaman ağacın bir yaprağıdır.
50
50
51
-
For instance, the `<title>`tag has the text `"About elks"`.
51
+
Örneğin, `<title>`etiketinde `"About elks"` metni bulunur.
52
52
53
-
Please note the special characters in text nodes:
53
+
Lütfen metin düğümlerindeki özel karakterlere dikkat edin:
54
54
55
-
-a newline: `↵` (in JavaScript known as`\n`)
56
-
-a space: `␣`
55
+
-yeni satır: `↵` (Javascript'te bilineni:`\n`)
56
+
-boşluk: `␣`
57
57
58
-
Spaces and newlines -- are totally valid characters, they form text nodes and become a part of the DOM. So, for instance, in the example above the `<head>` tag contains some spaces before `<title>`, and that text becomes a `#text` node (it contains a newline and some spaces only).
58
+
Boşluklar ve satır sonları tamamen geçerli karakterlerdir, metin düğümleri oluştup DOM'un bir parçası olurlar.
59
+
Dolayısıyla, örneğin yukarıdaki örnekte "<head>" etiketi, "<title>" dan önce bazı boşluklar içerir ve bu metin bir "#text" düğümü haline gelir (yalnızca bir satırsonu ve bazı boşluklar içerir).
59
60
60
-
There are only two top-level exclusions:
61
-
1.Spaces and newlines before `<head>` are ignored for historical reasons,
62
-
2.If we put something after `</body>`, then that is automatically moved inside the `body`, at the end, as the HTML spec requires that all content must be inside `<body>`. So there may be no spaces after `</body>`.
61
+
Yalnızca iki üst düzey istisna vardır:
62
+
1."<head>" öncesindeki boşluklar ve satırsonları tarihsel nedenlerden dolayı göz ardı edilir,
63
+
2."</body>" 'den sonra bir şey koyarsak, HTML spesifikasyonu tüm içeriğin "<body>" içinde olmasını gerektirdiğinden, bu otomatik olarak sonunda "body" nin içine taşınır. Dolayısıyla "</body>" öğesinden sonra boşluk kalmayabilir..
63
64
64
-
In other cases everything's straightforward -- if there are spaces (just like any character) in the document, then they become text nodes in DOM, and if we remove them, then there won't be any.
65
+
Diğer durumlarda her şey basittir; eğer belgede boşluklar varsa (tıpkı herhangi bir karakter gibi), o zaman bunlar DOM'da metin düğümleri olurlar ve eğer onları kaldırırsak, o zaman kaybolacaklardır.
```smart header="Edge spaces and in-between empty text are usually hidden in tools"
82
-
Browser tools (to be covered soon) that work with DOM usually do not show spaces at the start/end of the text and empty text nodes (line-breaks) between tags.
83
+
DOM ile çalışan tarayıcı araçları (yakında ele alınacaktır) genellikle metnin başında / sonunda boşluklar ve etiketler arasında boş metin düğümleri (satır sonları) göstermez.
83
84
84
-
That's because they are mainly used to decorate HTML, and do not affect how it is shown (in most cases).
85
+
Bunun nedeni, esas olarak HTML'yi dekore etmek için kullanılmaları ve gösterilme şeklini etkilememeleridir (çoğu durumda).
85
86
86
-
On further DOM pictures we'll sometimes omit them where they are irrelevant, to keep things short.
87
+
Daha fazla DOM resimlerinde, işleri kısa tutmak için bazen ilgisiz oldukları yerlerde bunları çıkarırız.
87
88
```
88
89
89
90
90
-
## Autocorrection
91
+
## Otomatik düzeltme
91
92
92
-
If the browser encounters malformed HTML, it automatically corrects it when making DOM.
93
+
Tarayıcı hatalı biçimlendirilmiş HTML ile karşılaşırsa, DOM oluştururken bunu otomatik olarak düzeltir.
93
94
94
-
For instance, the top tag is always `<html>`. Even if it doesn't exist in the document -- it will exist in the DOM, the browser will create it. The same goes for `<body>`.
95
+
Örneğin, en üstteki etiket her zaman <html> olur. Belgede olmasa bile - DOM'da bulunacak, tarayıcı onu oluşturacaktır. Aynısı <body> için de geçerlidir .
95
96
96
-
As an example, if the HTML file is a single word `"Hello"`, the browser will wrap it into `<html>` and `<body>`, add the required `<head>`, and the DOM will be:
97
+
Örnek olarak, HTML dosyası tek bir kelimeyse yani "Hello" gibi birşey ise , tarayıcı onu <html> içine saracak, gerekli olan <body> ve <head> kısmını ekleyecek ve DOM şu şekilde olacaktır:
97
98
98
99
99
100
<divclass="domtree"></div>
@@ -104,9 +105,9 @@ let node3 = {"name":"HTML","nodeType":1,"children":[{"name":"HEAD","nodeType":1,
104
105
drawHtmlTree(node3, 'div.domtree', 690, 150);
105
106
</script>
106
107
107
-
While generating the DOM, browsers automatically process errors in the document, close tags and so on.
108
+
DOM oluşturulurken, tarayıcılar belgedeki hataları otomatik olarak işler, etiketleri kapatır vb.
108
109
109
-
Such an document with unclosed tags:
110
+
Kapatılmamış etiketlere sahip böyle bir belge:
110
111
111
112
```html no-beautify
112
113
<p>Hello
@@ -115,7 +116,7 @@ Such an document with unclosed tags:
115
116
<li>Dad
116
117
```
117
118
118
-
...Will become a normal DOM, as the browser reads tags and restores the missing parts:
119
+
...Tarayıcı etiketleri okurken ve eksik kısımları geri yüklerken normal bir DOM haline gelecektir:
119
120
120
121
<divclass="domtree"></div>
121
122
@@ -125,16 +126,16 @@ let node4 = {"name":"HTML","nodeType":1,"children":[{"name":"HEAD","nodeType":1,
125
126
drawHtmlTree(node4, 'div.domtree', 690, 360);
126
127
</script>
127
128
128
-
````warn header="Tables always have`<tbody>`"
129
-
An interesting "special case" is tables. By the DOM specification they must have `<tbody>`, but HTML text may (officially) omit it. Then the browser creates `<tbody>` in DOM automatically.
129
+
````warn header="Tablolar her zaman`<tbody>` e sahiptir"
130
+
İlginç "özel durum" tablolardır. DOM şartnamesine göre <tbody> 'ye sahip olmaları gerekir, ancak HTML metni bunu (resmi olarak) ihmal edebilir. Ardından tarayıcı DOM içinde otomatik olarak <tbody> oluşturur.
130
131
131
-
For the HTML:
132
+
HTML gösterimi:
132
133
133
134
```html no-beautify
134
135
<tableid="table"><tr><td>1</td></tr></table>
135
136
```
136
137
137
-
DOM-structure will be:
138
+
DOM yapısı olarak:
138
139
<divclass="domtree"></div>
139
140
140
141
<script>
@@ -143,12 +144,14 @@ let node5 = {"name":"TABLE","nodeType":1,"children":[{"name":"TBODY","nodeType":
143
144
drawHtmlTree(node5, 'div.domtree', 600, 200);
144
145
</script>
145
146
146
-
You see? The`<tbody>`appeared out of nowhere. You should keep this in mind while working with tables to avoid surprises.
147
+
Gördünüz mü ? Aniden`<tbody>`ortaya çıktı. Sürprizlerden kaçınmak için tablolarla çalışırken bunu aklınızda bulundurmalısınız.
147
148
````
148
149
149
-
## Other node types
150
+
## Diğer düğüm türleri
151
+
152
+
Sayfaya daha fazla etiket ve bir yorum ekleyelim:
153
+
150
154
151
-
Let's add more tags and a comment to the page:
152
155
153
156
```html
154
157
<!DOCTYPE HTML>
@@ -174,88 +177,87 @@ let node6 = {"name":"HTML","nodeType":1,"children":[{"name":"HEAD","nodeType":1,
174
177
drawHtmlTree(node6, 'div.domtree', 690, 500);
175
178
</script>
176
179
177
-
Here we see a new tree node type -- *comment node*, labeled as `#comment`.
180
+
Burada yeni bir ağaç düğümü türü görüyoruz `#comment` olarak etiketlenmiş bir yorum düğümü.
178
181
179
-
We may think -- why is a comment added to the DOM? It doesn't affect the visual representation in any way. But there's a rule -- if something's in HTML, then it also must be in the DOM tree.
182
+
DOM'a neden bir yorum eklendiğini düşünebiliriz. Yorumlar sayfayı hiçbir şekilde etkilemez. Ancak bir kural vardır - HTML'de bir şey varsa, o zaman da DOM ağacında olmalıdır.
180
183
181
-
**Everything in HTML, even comments, becomes a part of the DOM.**
184
+
**HTML'deki her şey, hatta yorumlar bile DOM'un bir parçası haline gelir.**
182
185
183
-
Even the `<!DOCTYPE...>` directive at the very beginning of HTML is also a DOM node. It's in the DOM tree right before `<html>`. We are not going to touch that node, we even don't draw it on diagrams for that reason, but it's there.
186
+
HTML'nin en başındaki <! DOCTYPE...> yönergesi bile bir DOM düğümüdür. DOM ağacında <html> 'den hemen öncedir. Bu düğüme dokunmayacağız, hatta bu nedenle onu diyagramlar üzerine çizmeyeceğiz, ama oradadır.
184
187
185
-
The `document` object that represents the whole document is, formally, a DOM node as well.
188
+
Tüm belgeyi temsil eden `document` nesnesi, resmi olarak bir DOM düğümüdür
186
189
187
-
There are [12 node types](https://dom.spec.whatwg.org/#node). In practice we usually work with 4 of them:
190
+
[12 düğüm tipi](https://dom.spec.whatwg.org/#node) vardır. Pratikte genellikle 4 tanesiyle çalışırız:
188
191
189
-
1. `document` -- the "entry point" into DOM.
190
-
2. element nodes -- HTML-tags, the tree building blocks.
191
-
3. text nodes -- contain text.
192
-
4. comments -- sometimes we can put the information there, it won't be shown, but JS can read it from the DOM.
192
+
1. `document` -- DOM'a "giriş noktasıdır".
193
+
2. eleman düğümleri - HTML etiketleri, ağaç yapı taşları.
194
+
3. metin düğümleri - metin içerir.
195
+
4. yorumlar - bazen bilgileri oraya koyabiliriz, kullanıcıya gösterilmez, ancak JS bunu DOM'dan okuyabilir.
193
196
194
-
## See it for yourself
197
+
## Kendin gör
195
198
196
-
To see the DOM structure in real-time, try [Live DOM Viewer](http://software.hixie.ch/utilities/js/live-dom-viewer/). Just type in the document, and it will show up DOM at an instant.
199
+
DOM yapısını gerçek zamanlı görmek için, deneyin [Live DOM Viewer](http://software.hixie.ch/utilities/js/live-dom-viewer/). Sadece belgeyi yazın, DOM'u anında gösterecektir
197
200
198
-
## In the browser inspector
201
+
## Tarayıcı geliştirici araçlarında görün
199
202
200
-
Another way to explore the DOM is to use the browser developer tools. Actually, that's what we use when developing.
203
+
DOM'u keşfetmenin bir başka yolu da tarayıcı geliştirici araçlarını kullanmaktır. Aslında, geliştirirken kullandığımız şey bu.
201
204
202
-
To do so, open the web-page [elks.html](elks.html), turn on the browser developer tools and switch to the Elements tab.
205
+
Bunu yapmak için web sayfasını açın [elks.html](elks.html), tarayıcı geliştirici araçlarını açın ve Öğeler sekmesine geçin.
203
206
204
-
It should look like this:
207
+
Böyle görünmeli:
205
208
206
209

207
210
208
-
You can see the DOM, click on elements, see their details and so on.
211
+
DOM'u görebilir, öğelere tıklayabilir, ayrıntılarını görebilir ve daha fazlasını yapabilirsiniz.
209
212
210
-
Please note that the DOM structure in developer tools is simplified. Text nodes are shown just as text. And there are no "blank" (space only) text nodes at all. That's fine, because most of the time we are interested in element nodes.
213
+
Geliştirici araçlarındaki DOM yapısının basitleştirildiğini lütfen unutmayın. Metin düğümleri sadece metin olarak gösterilir. Ve "boş" (yalnızca boşluk) metin düğümleri de yoktur. Sorun değil, çünkü çoğu zaman eleman düğümleriyle ilgileniyoruz.
211
214
212
-
Clicking the <span class="devtools" style="background-position:-328px -124px"></span> button in the left-upper corner allows to choose a node from the webpage using a mouse (or other pointer devices) and "inspect" it (scroll to it in the Elements tab). This works great when we have a huge HTML page (and corresponding huge DOM) and would like to see the place of a particular element in it.
215
+
Sol üst köşedeki düğmeyi tıklamak <span class="devtools" style="background-position:-328px -124px"></span>, bir fare (veya diğer işaretçi aygıtları) kullanarak web sayfasından bir düğüm seçmeye ve onu "incelemeye" (Öğeler sekmesinde ona kaydırın) izin verir. Bu, büyük bir HTML sayfamız (ve buna karşılık gelen devasa DOM) olduğunda ve içindeki belirli bir öğenin yerini görmek istediğinde harika çalışıyor.
216
+
217
+
Bunu yapmanın başka bir yolu da bir web sayfasına sağ tıklayıp içerik menüsünde "İncele" yi seçmektir.
213
218
214
-
Another way to do it would be just right-clicking on a webpage and selecting "Inspect" in the context menu.
215
219
216
220

217
221
218
-
At the right part of the tools there are the following subtabs:
219
-
- **Styles** -- we can see CSS applied to the current element rule by rule, including built-in rules (gray). Almost everything can be edited in-place, including the dimensions/margins/paddings of the box below.
220
-
- **Computed** -- to see CSS applied to the element by property: for each property we can see a rule that gives it (including CSS inheritance and such).
221
-
- **Event Listeners** -- to see event listeners attached to DOM elements (we'll cover them in the next part of the tutorial).
222
-
- ...and so on.
222
+
Araçların sağ tarafında aşağıdaki alt sekmeler bulunur:
223
223
224
-
The best way to study them is to click around. Most values are editable in-place.
224
+
- **Stiller(Styles)** -- CSS'nin, yerleşik kurallar (gri) dahil olmak üzere belirli öğelere kurallar uygulandığını görebiliriz. Aşağıdaki kutunun boyutları / kenar boşlukları / dolgular dahil hemen hemen her şey yerinde düzenlenebilir.
225
+
- **Hesaplanmış (Computed)** -- öğeye uygulanan özellikleri CSS'de görmek için: her özellik için onu veren bir kural görebiliriz (CSS mirası vb. dahil).
226
+
- **Olay Dinleyicileri (Event Listeners)** -- DOM öğelerine eklenen olay dinleyicilerini görmek için (serinin sonraki bölümünde bunları ele alacağız).
227
+
…ve bunun gibi.
225
228
226
-
## Interaction with console
229
+
Bunları incelemenin en iyi yolu, öğeye tıklamaktır. Değerlerin çoğu yerinde düzenlenebilir.
227
230
228
-
As we explore the DOM, we also may want to apply JavaScript to it. Like: get a node and run some code to modify it, to see the result. Here are few tips to travel between the Elements tab and the console.
231
+
## Konsol ile etkileşim
229
232
230
-
- Select the first `<li>` in the Elements tab.
231
-
- Press `key:Esc` -- it will open console right below the Elements tab.
233
+
DOM'u keşfederken, ona JavaScript de uygulamak isteyebiliriz. Örneğin: bir düğüm alın ve sonucu görmek için onu değiştirmek için bir kod çalıştırın. Öğeler sekmesi ve konsol arasında gezinmek için birkaç ipucu.
232
234
233
-
Now the last selected element is available as `$0`, the previously selected is `$1` etc.
235
+
- Öğeler sekmesinde ilk `<li>` öğesini seçin.
236
+
- `key:Esc` tuşuna basın - konsolu Elements sekmesinin hemen altında açacaktır.
234
237
235
-
We can run commands on them. For instance, `$0.style.background = 'red'` makes the selected list item red, like this:
238
+
Artık son seçilen öğe `$0` olarak mevcut, önceden seçilen öğe `$1` vb.
236
239
237
-

240
+
Onlara komutlar çalıştırabiliriz. Örneğin, `$0.style.background = 'red'` seçilen liste öğesini şu şekilde kırmızı yapar:
238
241
239
-
From the other side, if we're in console and have a variable referencing a DOM node, then we can use the command `inspect(node)` to see it in the Elements pane.
240
-
241
-
Or we can just output it in the console and explore "at-place", like `document.body` below:
242
+

242
243
244
+
Diğer taraftan, eğer konsoldaysak ve bir DOM düğümünü referans alan bir değişkenimiz varsa, o zaman komutu `inspect(node)` Elementler bölmesinde görmek için kullanabiliriz.
245
+
Ya da bunu konsola çıkarabilir ve `document.body` kısmını aşağıdaki gibi "yerinde" keşfedebiliriz:
243
246

244
247
245
-
That's for debugging purposes of course. From the next chapter on we'll access and modify DOM using JavaScript.
246
-
247
-
The browser developer tools are a great help in development: we can explore the DOM, try things and see what goes wrong.
248
+
Bu elbette hata ayıklama amaçlıdır. Bir sonraki bölümde DOM'a JavaScript kullanarak erişip değiştireceğiz.
248
249
249
-
## Summary
250
+
Tarayıcı geliştirici araçları, geliştirmede harika bir yardımcıdır: DOM'u keşfedebilir, bir şeyler deneyebilir ve neyin yanlış gittiğini görebiliriz.
250
251
251
-
An HTML/XML document is represented inside the browser as the DOM tree.
252
+
## Özet
252
253
253
-
- Tags become element nodes and form the structure.
254
-
- Text becomes text nodes.
255
-
- ...etc, everything in HTML has its place in DOM, even comments.
254
+
Bir HTML / XML belgesi tarayıcının içinde DOM ağacı olarak temsil edilir.
256
255
257
-
We can use developer tools to inspect DOM and modify it manually.
256
+
- Etiketler eleman düğümleri haline gelir ve yapıyı oluşturur.
257
+
- Metin, metin düğümleri haline gelir.
258
+
- HTML'deki her şeyin yeri, hatta yorumlar da DOM'da vardır.
258
259
259
-
Here we covered the basics, the most used and important actions to start with. There's an extensive documentation about Chrome Developer Tools at <https://developers.google.com/web/tools/chrome-devtools>. The best way to learn the tools is to click here and there, read menus: most options are obvious. Later, when you know them in general, read the docs and pick up the rest.
260
+
DOM'u incelemek ve manuel olarak değiştirmek için geliştirici araçlarını kullanabiliriz.
261
+
Burada, başlangıç için en çok kullanılan ve önemli eylemlerin temellerini ele aldık. Chrome Geliştirici Araçları hakkında kapsamlı bir dokümantasyon vardır <https://developers.google.com/web/tools/chrome-devtools>. Bu araçları öğrenmenin en iyi yolu, onlara tıklamak, menüleri okumaktır. Çoğu seçenek tıklamaya açıktır. Daha sonra, onları genel olarak tanıdığınızda, belgeleri okuyun ve gerisini alın.
260
262
261
-
DOM nodes have properties and methods that allow to travel between them, modify, move around the page and more. We'll get down to them in the next chapters.
263
+
DOM düğümleri, aralarında gezinmeye, değiştirmeye, sayfada dolaşmaya ve daha pek çok şeye izin veren özelliklere ve yöntemlere sahiptir. Sonraki bölümlerde onlara değineceğiz.
0 commit comments