Rocksolid Light

groups  faq  privacy  How to post  login

Message-ID:  

You had some happiness once, but your parents moved away, and you had to leave it behind.


rocksolid / de.comp.lang.javascript / Zugruff auf Variable innerhalb document.ready function ...

SubjectAuthor
* Zugruff auf Variable innerhalb document.ready function ...Jan Novak
`* Re: Zugruff auf Variable innerhalb document.ready function ...Stefan Reuther
 `- Re: Zugruff auf Variable innerhalb document.ready function ...Jan Novak

1
Subject: Zugruff auf Variable innerhalb document.ready function ...
From: Jan Novak
Newsgroups: de.comp.lang.javascript
Date: Thu, 22 Jun 2023 11:58 UTC
Path: i2pn2.org!i2pn.org!news.nntp4.net!.POSTED!not-for-mail
From: rep...@gmail.com (Jan Novak)
Newsgroups: de.comp.lang.javascript
Subject: Zugruff auf Variable innerhalb document.ready function ...
Date: Thu, 22 Jun 2023 13:58:22 +0200
Message-ID: <u71d0v$1nd7q$1@news.nnpt4.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: eJwljUEKwjAQRdd6iiErBVObaKE0FAruXNcDxDS2gXYmmAni7a36Vn/x+A/9KxWIkc8FejYQKXHAUVrnKCO34v6gZ3Td205ExeCF2W5mGsevM1i2rVC1qupSCwOLDbN0tMTZBuQkmVqRk19/O/xnOP4yAo7QT/kAWsM1I+hSn0CppqqbdchyBXa3/rL/AM91Mdw=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:KVEX5ESbgG86JcLUmoVKsbbZuXE=
Content-Language: de-DE
X-Abuse-Contact: "https://abuse.nntp4.net"
View all headers

Hallo,

eigentlich wollte ich es so machen:

class Test {
var o5Session=getSession();
constructor() {
$(document).ready( function () {
$("#info").text(this.o5Session.user.MAIL_ACCOUNT.user);
});
}
}

Das geht aber nicht, weil "this.o5Session" nicht in der Funktion
verfügbar ist. Ich habe es jetzt also so gelöst:

var o5Session=getSession();
class Test {
constructor() {
$(document).ready( function () {
$("#info").text(o5Session.user.MAIL_ACCOUNT.user);
});
}
}

Es muss aber doch eine bessere Lösung geben, als die Variable o5Session
Global zu definieren.

Jan

Subject: Re: Zugruff auf Variable innerhalb document.ready function ...
From: Stefan Reuther
Newsgroups: de.comp.lang.javascript
Date: Thu, 22 Jun 2023 16:34 UTC
References: 1
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: stefan.n...@arcor.de (Stefan Reuther)
Newsgroups: de.comp.lang.javascript
Subject: Re: Zugruff auf Variable innerhalb document.ready function ...
Date: Thu, 22 Jun 2023 18:34:04 +0200
Lines: 17
Message-ID: <u7246s.17s.1@stefan.msgid.phost.de>
References: <u71d0v$1nd7q$1@news.nnpt4.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net rAahOJ2H1BJHos/BciKw5QYVYqJmlkGWkbyUhX4He5sBmTnqwy
Cancel-Lock: sha1:YiWkLW/vVrVRI5DhcpCpQChWpIk=
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.12.1 Hamster/2.1.0.1538
In-Reply-To: <u71d0v$1nd7q$1@news.nnpt4.net>
View all headers

Am 22.06.2023 um 13:58 schrieb Jan Novak:
> class Test {
>     var o5Session=getSession();
>     constructor() {
>         $(document).ready( function () {
>             $("#info").text(this.o5Session.user.MAIL_ACCOUNT.user);
>         });
>     }
> }

var me = this;
$(document).ready( function () {
$("#info").text(me.o5Session.user.MAIL_ACCOUNT.user);
});

Stefan

Subject: Re: Zugruff auf Variable innerhalb document.ready function ...
From: Jan Novak
Newsgroups: de.comp.lang.javascript
Organization: MB-NET.NET for Open-News-Network e.V.
Date: Fri, 23 Jun 2023 04:46 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mb-net.net!open-news-network.org!.POSTED.246-9-133-n4.customer.vsm.sh!not-for-mail
From: rep...@gmail.com (Jan Novak)
Newsgroups: de.comp.lang.javascript
Subject: Re: Zugruff auf Variable innerhalb document.ready function ...
Date: Fri, 23 Jun 2023 06:46:51 +0200
Organization: MB-NET.NET for Open-News-Network e.V.
Message-ID: <u7383s$1d7i4$1@gwaiyur.mb-net.net>
References: <u71d0v$1nd7q$1@news.nnpt4.net>
<u7246s.17s.1@stefan.msgid.phost.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Jun 2023 04:46:52 -0000 (UTC)
Injection-Info: gwaiyur.mb-net.net; posting-host="246-9-133-n4.customer.vsm.sh:170.133.9.246";
logging-data="1482308"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:nt46gVPWZvonxJQiojvfGZMxqPE= sha256:jiENGGqjq8DSQlmpDkub/83yp+2UC1XfNwPzNefXR8Q=
sha1:cQRfd4kWsJ2OwBgwhcJ+UP87ujQ= sha256:tJ6T4PbW+Ekn7TMAXjhXJTIuKWxEE50BtZgpeOGlVus=
Content-Language: de-DE
In-Reply-To: <u7246s.17s.1@stefan.msgid.phost.de>
View all headers

Am 22.06.23 um 18:34 schrieb Stefan Reuther:
> Am 22.06.2023 um 13:58 schrieb Jan Novak:
>> class Test {
>>     var o5Session=getSession();
>>     constructor() {
>>         $(document).ready( function () {
>>             $("#info").text(this.o5Session.user.MAIL_ACCOUNT.user);
>>         });
>>     }
>> }
>
> var me = this;
> $(document).ready( function () {
> $("#info").text(me.o5Session.user.MAIL_ACCOUNT.user);
> });

Ich habe mir im Netz einen Wolf gesucht ... und dann gehts so einfach.
Danke!

Jan


rocksolid / de.comp.lang.javascript / Zugruff auf Variable innerhalb document.ready function ...

1
server_pubkey.txt

rocksolid light 0.9.136
clearnet tor