🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: object + callback = problem

#51092
From: witold.zywica
Date: Tue, 17 Apr 2012 12:04
22 lines
1679 bytes
W dniu wtorek, 17 kwietnia 2012 13:13:29 UTC+2 użytkownik satellite napisał:
> On 2012-04-17 11:50, Witold Zywica wrote:
> 
> o, w tym wypadku wydaje mi sie ze problem jest tu :
> 
> >    this.loadData = function () {
> >      $.getJSON('skrypt.php', this.callback);
> >    }
> 
> this w getJson jest this getJson - a nie Twojej funkcji - ale mozesz 
> uniknac 'porywania' this, w taki np. sposob :
> 
> function test(){
> 
> var that = this;
> 
> that.loadData = function () {
> $.getJSON('skrypt.php', that.callback);
> }
> 
> 
> }
Technical Details
Message-ID: <25796755.1534.1334664255103.JavaMail.geo-discussion-forums@vbut24>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!goblin1!goblin.stu.neva.ru!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <fd024171-140c-4cb5-885b-4ca0ceacf3fa@z17g2000yqf.googlegroups.com> <jmjj8p$oun$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!goblin1!goblin.stu.neva.ru!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From: witold.zywica@gmail.com
Newsgroups: pl.comp.lang.javascript
Subject: Re: object + callback = problem
Date: Tue, 17 Apr 2012 05:04:15 -0700 (PDT)
Organization: http://groups.google.com
Lines: 24
Message-ID: <25796755.1534.1334664255103.JavaMail.geo-discussion-forums@vbut24>
References: <fd024171-140c-4cb5-885b-4ca0ceacf3fa@z17g2000yqf.googlegroups.com> <jmjj8p$oun$1@inews.gazeta.pl>
NNTP-Posting-Host: 194.251.119.198
Mime-Version: 1.0
X-Trace: posting.google.com 1334664718 9431 127.0.0.1 (17 Apr 2012 12:11:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 17 Apr 2012 12:11:58 +0000 (UTC)
In-Reply-To: <jmjj8p$oun$1@inews.gazeta.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.251.119.198; posting-account=GCQVcgoAAADjp-6CvhS4IjykuPgElWlE
User-Agent: G2/1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit