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.

JavaScript erkennt ChildNodes nicht (Dojo)

Empfohlene Antworten

Veröffentlicht

Hallo,

seit nunmehr 2 Stunden sitze ich über einem Problem, was mein bester Freund Google und ich nicht gelöst bekommen:

Es geht um eine HTML-Tabelle, die ich mit Smarty erstmal Grundlegend aufbaue, die sieht etwa so aus:


<table id="qi_body">

 <tr><td class="cell">

   Inhalt

 </td></tr>

 <tr><td class="cell">

   Inhalt

 </td></tr>

 {foreach from=$qi item='data' key='key'}

  <tr id="{$key}"><td class="cell">

   Inhalt

  </td></tr>

 {/foreach}

</table>

Und ich möchte jetzt mit einer Javascript Funktion, die mit Dojo arbeitet da erstmal nur die Element (children) auszählen, dazu gebe ich mir erstmal in einem alert Testweise die Kind-Elemente aus:
alert(dojo.query("#qi_body").children());

Das große Problem ist nun: Ob nun mit Dojo oder mit einfachem JS, ich bekomme die beim laden vorhandene Elemente (tr's; wenigstens 2, aber auch mehr) nicht von JS zurückgegeben. Also die Elemente werden nicht erkannt. Füge ich jetzt welche mit Javascript hinzu, erkennt er die ohne Probleme und gibt mir die (per JS hinzugefügten) Elemente wieder.

Weiss dazu jemand eine Lösung oder kann mir sagen, warum das so ist??

,mfg und danke schön mal

Bearbeitet von tallman

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.