๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: zgubiona skladowa obiektu

#39799
From: psd
Date: Mon, 08 May 2006 20:46
21 lines
1245 bytes
Grzegorz ลšlusarek wrote:

> MyPage= Page()

Brakuje "new":

MyPage = new Page()

MyPage to zmienna globalna wiec ta funkcja nie ma sensu:

> function getPage() {
> if(!MyPage) {
>     MyPage = new Page();
> }
> return MyPage;
> }

> wskazuje mi undefined. Tuz po inicjalizacji w html wskazuje 1 ale juz 
> jak sie odwoluje w skryptach to mam undefined. Dlaczego?

dopiero w funkcji tworzyles obiekt (masz tam "new")
Technical Details
Message-ID: <e3oaj2$nnu$1@achot.icm.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news2.icm.edu.pl!not-for-mail
References: <e3n8gh$222e$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news2.icm.edu.pl!not-for-mail
From: psd <psd@gdzies.tam>
Newsgroups: pl.comp.lang.javascript
Subject: Re: zgubiona skladowa obiektu
Date: Mon, 08 May 2006 22:46:33 +0200
Organization: http://news.icm.edu.pl/
Lines: 21
Message-ID: <e3oaj2$nnu$1@achot.icm.edu.pl>
References: <e3n8gh$222e$1@node2.news.atman.pl>
NNTP-Posting-Host: chello087207120064.chello.pl
Mime-Version: 1.0
X-Trace: achot.icm.edu.pl 1147121058 24318 87.207.120.64 (8 May 2006 20:44:18 GMT)
X-Complaints-To: abuse@icm.edu.pl
NNTP-Posting-Date: Mon, 8 May 2006 20:44:18 +0000 (UTC)
In-Reply-To: <e3n8gh$222e$1@node2.news.atman.pl>
X-Accept-Language: en-us, en
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit