Article View: pl.comp.lang.javascript
Article #39798zgubiona skladowa obiektu
From: Grzegorz Ślusarek
Date: Mon, 08 May 2006 11:06
Date: Mon, 08 May 2006 11:06
21 lines
1284 bytes
1284 bytes
Witam. Mam sytuacje ze przy ladowaniu strony tworze obiekt z 4 skladowymi:
function Page() {
this.page = 0;
this.result = 0
this.resultCount =1;
this.currentPage =1;
}
MyPage= Page()
potem w skryptach odwoluje sie do niego
w nastepujacy sposon
function getPage() {
if(!MyPage) {
MyPage = new Page();
}
return MyPage;
}
ale obiekt gubi mi jedną składową mianowicie - MyPage.currentPage
wskazuje mi undefined. Tuz po inicjalizacji w html wskazuje 1 ale juz
jak sie odwoluje w skryptach to mam undefined. Dlaczego?
Grzegorz
Technical Details
Message-ID:
<e3n8gh$222e$1@node2.news.atman.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.atman.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.atman.pl!not-for-mail From: Grzegorz Ślusarek <against@spam.pl> Newsgroups: pl.comp.lang.javascript Subject: zgubiona skladowa obiektu Date: Mon, 08 May 2006 13:06:54 +0200 Organization: ATMAN Lines: 21 Message-ID: <e3n8gh$222e$1@node2.news.atman.pl> NNTP-Posting-Host: saturn.atm.com.pl Mime-Version: 1.0 X-Trace: node2.news.atman.pl 1147086161 67662 217.17.34.18 (8 May 2006 11:02:41 GMT) X-Complaints-To: abuse@atman.pl NNTP-Posting-Date: Mon, 8 May 2006 11:02:41 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: pl, en-us, en Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit