🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Brak zasiegu dla zmiennej

#49704
From: lamer
Date: Wed, 20 Jan 2010 18:05
17 lines
1577 bytes
Witam,
Jest strona, kodu masa, ale fragment jest z grubsza taki:

<script type="text/javascript">
var siema='siemano';
alert(siema);
</script>

<a href="#" onClick="alert(siema)">KLIK</a>

Po zaladowaniu strony wyskakuje okienko z napisem "siemano". Po nacisnieciu 
KLIK dostaje blad "siema is undefined".
Miedzy ta wstawka w JS a linkiem nie ma innych wstawek JS. Nazwa zmiennej 
jest wzieta z sufitu, wiec raczej nic jej nie usuwa/nadpisuje.
Jak to wiec mozliwe, ze jest undefined w linku?

lamer 
Technical Details
Message-ID: <hj7hae$sen$1@nemesis.news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: "lamer" <lamer@pl.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Brak zasiegu dla zmiennej
Date: Wed, 20 Jan 2010 19:05:44 +0100
Organization: TP - http://www.tp.pl/
Lines: 18
Message-ID: <hj7hae$sen$1@nemesis.news.neostrada.pl>
NNTP-Posting-Host: abyz244.neoplus.adsl.tpnet.pl
Mime-Version: 1.0
X-Trace: nemesis.news.neostrada.pl 1264011407 29143 83.9.45.244 (20 Jan 2010 18:16:47 GMT)
X-Complaints-To: usenet@news.neostrada.pl
NNTP-Posting-Date: Wed, 20 Jan 2010 18:16:47 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit