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.

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich möchte über einen Link ein Fenster mittels Javascript öffnen. Soweit so gut, das klappt eigentlich auch. Nun Möchte ich aber den Text, der in einer PHP Variable steht, mit übergeben, um diesen dann wiederrum in der Datei zu nutzen die ich in das Fenster lade. Wie muss ich das schreiben?

Hier mein Link:

<a href=\"javascript:CallBeschreibung(    Hier soll dann das hin was ich nicht weiß    );\">Beschreibung</a>
Mein Javascript code dazu sieht folgendermaßen aus:
<script language="JavaScript">

<!--

function CallBeschreibung(Path)

{

    beschreibungfenster = window.open("Beschreibung.php?Text="+Path, "Beschreibung", "width=455,height=190");

    beschreibungfenster.focus();

}


// -->

</script>
Nehme ich nicht eine Variable, sondern nur einen Text, also so:
<a href=\"javascript:CallBeschreibung('Testtext');\">Beschreibung</a>

dann klappt es. Was also muss ich als Parameter übergeben, wenn ich eine Variable $Beschreibung habe?

Bine

Das ganze ist bei mir schon in php:

echo "<td width=\"300\" align=\"right\"><a href=\"javascript:CallBeschreibung(    ???    );\">Beschreibung</a></td>";
Und wenn ich einfach
echo "<td width=\"300\" align=\"right\"><a href=\"javascript:CallBeschreibung($Beschreibung);\">Beschreibung</a></td>";

schreibe, dann klappt es nicht. Fehler auf der Seite - aber ich weiß nicht was!

Bine

Klappt auch nicht. Und der Fehler muss in der Zeile sein, da es wie schon gesagt funktioniert, wenn ich einfach

'Test'

in die Klammern schreibe!

Bine

Zum testen einfach nur Testbeschreibung!

Bine

Ich habs:

echo "<td width=\"100\" align=\"left\"><b> <a href=\"javascript:CallBeschreibung('". $Beschreibung ."');\">Beschreibung</a></b></td>";

Und da soll jemand drauf kommen ?!?! :D Danke trotzdem für Deine Hilfe!

Bine

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.