🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: div (browser detect)

#304
From: Piotr Pawłow
Date: Wed, 09 Jan 2002 00:39
17 lines
1529 bytes
[sis] wrote:

> ns6 = (document.getElementById)?1:0;

Oj nie, Explorer od wersji, zdaje się, 5.0 też posiada getElementById()

Generalnie przy korzystaniu z DOM zamiast sugerować się typem
przeglądarki lepiej po prostu sprawdzić co jest i tego używać.
Natomiast przy wybieraniu różnych wersji kodu HTML, styli, w zależności
od danej rodziny przeglądarek, lepiej używać właściwości obiektu navigator.

Polecam też zajrzeć tutaj:
http://developer.netscape.com/evangelism/docs/api/

-- 
 Piotr Pawłow
 mailto: pp@siedziba.pl  homepage: http://pp.siedziba.pl
Technical Details
Message-ID: <3C3B914C.3080208@siedziba.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!warszawa.rmf.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail
References: <3c3add07$1@news.vogel.pl> <MPG.16a503602d7044f5989705@news.tpi.pl> <3c3aedf6@news.vogel.pl> <a1f1kc$ec$1@news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!warszawa.rmf.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail
From: Piotr Pawłow <pp@siedziba.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Re: div (browser detect)
Date: Wed, 09 Jan 2002 01:39:40 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 18
Message-ID: <3C3B914C.3080208@siedziba.pl>
References: <3c3add07$1@news.vogel.pl> <MPG.16a503602d7044f5989705@news.tpi.pl> <3c3aedf6@news.vogel.pl> <a1f1kc$ec$1@news.tpi.pl>
NNTP-Posting-Host: pp158.warszawa.sdi.tpnet.pl
Mime-Version: 1.0
X-Trace: news.tpi.pl 1010537910 5970 213.25.55.158 (9 Jan 2002 00:58:30 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Wed, 9 Jan 2002 00:58:30 +0000 (UTC)
X-Accept-Language: en-us
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011120
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit