🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #39183

Re: childNodes -> DOM XML

#39183
From: thauthim
Date: Fri, 24 Mar 2006 17:28
32 lines
2149 bytes
yew napisał(a):
> Jacek Karczmarczyk napisał(a):
> 
>> thauthim napisał(a):
>>> problem w tym, ze zamiast dostac dlugosc - 15, dostaje 31. testujac 
>>> sobie po kolei poprzez alert(kraje[jakas_liczba].firstChild.data) 
>>> okazuje sie, ze co druga wartosc w 'kraje' jest pusta, tzn gdy robie np
>>>
>>> alert(kraje[1].firstChild.data) to dostaje 'Afganistan'
>>> alert(kraje[3].firstChild.data) to dostaje 'Albania'
>>>
>>> a dla alert(kraje[0].firstChild.data) i 
>>> alert(kraje[2].firstChild.data) dostaje puste wartosci.
>>>
>>> Czy ktos moglby mi wytlumaczyc o co chodzi i jak temu zaradzic?
>>
>> pomiędzy poszczególnymi nodami typu <lista /> masz "textnody" 
>> składające się z samych spacji/enterów, musisz sprawdzać nodetype czy 
>> coś w tym rodzaju
>> pewnie zaraz ktoś bardziej obeznany trochę dokładniej to opisze, ale 
>> generalnie wydaje mi się że o to właśnie chodzi
> 
> 
> Dokładnie tak a konkretniej ta wartość nazywa się nodeType:
> 1 - Element
> 2 - Atrybut
> 3 - Text
> 
> Tak więc Ciebie interesują węzły z nodeType = 1.
> 

dokladnie o to chodzilo. dziekuje i pozdrawiam ;)
Technical Details
Message-ID: <e01a25$89h$2@news.task.gda.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!not-for-mail
References: <dvrqef$io6$1@news.task.gda.pl> <dvrqko$ciu$1@node3.news.atman.pl> <dvrtq2$rfg$1@news.dialog.net.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.task.gda.pl!not-for-mail
From: thauthim <ufoczysko@interia.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Re: childNodes -> DOM XML
Date: Fri, 24 Mar 2006 18:28:22 +0100
Organization: CI TASK http://news.task.gda.pl/
Lines: 32
Message-ID: <e01a25$89h$2@news.task.gda.pl>
References: <dvrqef$io6$1@news.task.gda.pl> <dvrqko$ciu$1@node3.news.atman.pl> <dvrtq2$rfg$1@news.dialog.net.pl>
NNTP-Posting-Host: it.wp-sa.pl
Mime-Version: 1.0
X-Trace: news.task.gda.pl 1143221125 8497 212.77.105.136 (24 Mar 2006 17:25:25 GMT)
X-Complaints-To: abuse@news.task.gda.pl
NNTP-Posting-Date: Fri, 24 Mar 2006 17:25:25 +0000 (UTC)
X-Organization-Notice: Organization line has been filtered
In-Reply-To: <dvrtq2$rfg$1@news.dialog.net.pl>
User-Agent: Thunderbird 1.5 (X11/20051201)
X-Original-Organization: CI TASK http://www.task.gda.pl/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit