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 variable übergeben

Empfohlene Antworten

Veröffentlicht

Hallo an alle

Ich sitze hier an einem Problem und komme nicht weiter.

Folgendes:

Über einen Onclick-event wird eine js-function aufgerufen und dieser eine Varaible übergeben die einen Teil eines Pfades enthält.

Der Aufruf sieht so aus:

echo "<a href=\"#\" onclick=\"fnc_showLayer_zwei ( " .$dat_documents['docIdMd5'] . " ) \">";

In dieser function werden Iframes auf "sichtbar" gesetzt, und der Pfad ist eigentlich nur ein nebenprodukt.

Die Funktion sieht so aus:

function fnc_showLayer_zwei (pfad)

{

pfade = pfad;

parent.document.getElementById('divzwei').style.visibility='visible';

parent.document.getElementById('ifr_zwei').style.visibility='visible';

}

Die Variable "pfade" ist GLOBAL gesetzt.

Nun möchte ich erreichen das die Variable "pfade" in einem Iframe in der "src" anweisung eingefügt wird.

Mein bisheriger Versuch sieht so aus:

<iframe src ="./popups/#####/ ' + pfade + ' /index.php;" class="iframeAll"...

Das klappt hinten und vorne nicht.

Könnt ihr mir sagen was ich falsch mache. Ich weiß nicht mehr weiter.

Danke im vorraus

Vbler

Hallo,

ich weiß jetzt nicht ob es klappt aber ich könnte mir vorstellen das dies klappt.

document.getElementById(ID_des_iframe).src='test.php';

Hier musst du den frame erst eine Id zuweisen.

Das ist ungetestet daher weiß ich nicht ob es klappt.

Mit freundlichen Grüßen

Mike1990

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.