From 7bdff5ed7119adc537a9bd5beb8416e49271a171 Mon Sep 17 00:00:00 2001 From: Yunus YILMAZ <33022125+yy34@users.noreply.github.com> Date: Fri, 29 Jan 2021 19:41:23 +0300 Subject: [PATCH] Walking the DOM some of it has been translated. --- 2-ui/1-document/03-dom-navigation/article.md | 30 +++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/2-ui/1-document/03-dom-navigation/article.md b/2-ui/1-document/03-dom-navigation/article.md index 645d0ab60..e08f6161e 100644 --- a/2-ui/1-document/03-dom-navigation/article.md +++ b/2-ui/1-document/03-dom-navigation/article.md @@ -5,37 +5,39 @@ libs: --- -# Walking the DOM +# Dom'da gezinme -The DOM allows us to do anything with elements and their contents, but first we need to reach the corresponding DOM object. +DOM, elementler ve içerikleri ile her şeyi yapmamıza izin verir, ancak önce ilgili DOM nesnesine ulaşmamız gerekir. -All operations on the DOM start with the `document` object. From it we can access any node. +DOM üzerindeki tüm işlemler `document` nesnesiyle başlar. Bu nesneden herhangi bir düğüme erişebiliriz. -Here's a picture of links that allow for travel between DOM nodes: +DOM düğümleri arasında dolaşmaya izin veren bağlantıların bir görüntüsü: ![](dom-links.svg) -Let's discuss them in more detail. +Bunlara daha ayrıntılı değinelim. -## On top: documentElement and body +## Üstte: documentElement ve body -The topmost tree nodes are available directly as `document` properties: +En üstteki ağaç düğümleri doğrudan `document` özellikleri olarak kullanılabilir: `` = `document.documentElement` -: The topmost document node is `document.documentElement`. That's DOM node of `` tag. +: En üstteki belge düğümü `document.documentElement`'tir. Bu, `` etiketinin DOM düğümüdür. `` = `document.body` -: Another widely used DOM node is the `` element -- `document.body`. +: Yaygın olarak kullanılan başka bir DOM düğümü, `` elementidir -- `document.body`. `` = `document.head` -: The `` tag is available as `document.head`. +: `` etiketi `document.head` olarak mevcuttur. -````warn header="There's a catch: `document.body` can be `null`" -A script cannot access an element that doesn't exist at the moment of running. -In particular, if a script is inside ``, then `document.body` is unavailable, because the browser did not read it yet. -So, in the example below the first `alert` shows `null`: +````warn header="Bir yakalama var: `document.body`, `null` olabilir." +Bir komut dosyası (script), çalışma anında mevcut olmayan bir öğeye erişemez. + +Özellikle, bir komut dosyası `` içindeyse, tarayıcı henüz okumadığı için `document.body` kullanılamaz. + +Bu nedenle, aşağıdaki örnekte ilk `alert` `null` gösterir: ```html run