Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JScript Objekte: übergeordnetes Obj ansprechen.

Empfohlene Antworten

Veröffentlicht

Hallo JScript-Freaks.

Meine Frage:

ich erzeuge ein selbst definiertes JScript-Objekt. Diesem weise ich als eigenschaft einen Array zu, welcher dann ein "unterobjekt" wird.

function class_a() {

// klasse des objektes

this.etwas = true;

this.b = new Array();

}

class_a.prototype.addB = function( wert ){

// methode, um unterobjekte hinzuzufügen

this.b[ this.b.length ] = new class_b( wert );

}

function class_b( wert ) {

// klasse des unterobjektes

this.wert = wert;

// hier will ich nun auf das "etwas" zugreifen

}

var myObj = new class_a();

myObj.addB( "hallo" );

myObj.addB( "welt" );

alert( myObj.b[1].wert ); // gibt "welt" aus

Nur, wie zur Hölle, kann ich nun im b-objekt auf properties des a-objektes zugreifen??

ich steh vor´m Berg.

Apropos Berg:

Ein Frosch will einen zehn Meter hohen Berg erklimmen.

Am ersten Tag schafft er fünf Meter, aber in der Nacht rutscht er wieder vier Meter zurück. An welchem Tag erreicht er die Spitze?

Gruss Matze

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Zitat:</font><HR>Original erstellt von lapso:

<STRONG>Hallo JScript-Freaks.

Nur, wie zur Hölle, kann ich nun im b-objekt auf properties des a-objektes zugreifen??

ich steh vor´m Berg.

Gruss Matze</STRONG>

  • 2 Wochen später...

<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Zitat:</font><HR>Original erstellt von lapso:

<STRONG>Hallo JScript-Freaks.

Meine Frage:

</STRONG>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.