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 im JavaScript?

Empfohlene Antworten

Veröffentlicht

Hallo Leute!

Ist es möglich, dass ich innerhalb eines JavaScripts weiteren, untergeordneten JavaScript einbinde?

Der Hintergrund ist, dass ich aus Arrays Felder füllen lasse, bei einem Absendebutton allerding in einer weiteren Script-Instanz (innerhalb des Scripts) eine Auswertung machen möchte.

Grob gesehen sieht es dann so aus:

<script language="JavaScript>

//....

document.write("<input type=text value="array");

//...

document.write("a href=\"<script language=\"JavaScript\">document.write(blah)</script> )";

//...

</script>;

Und um euch noch weiter zu verwirren: Die Arrays werden noch dynamisch durch ein JSP gefüllt, das ist aber erstmal egal.

Kern der Frage: JavaScript im JavaScript - möglich oder nicht. Danke für eure Hilfe!

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

<STRONG>Grob gesehen sieht es dann so aus:

<script language="JavaScript>

//....

document.write("<input type=text value="array");

//...

document.write("a href=\"<script language=\"JavaScript\">document.write(blah)</script> )";

//...

</script>;

Und um euch noch weiter zu verwirren: Die Arrays werden noch dynamisch durch ein JSP gefüllt, das ist aber erstmal egal.

Kern der Frage: JavaScript im JavaScript - möglich oder nicht. Danke für eure Hilfe!</STRONG>

Danke für die Hilfe. Ich spiel noch ein bisl rum, noch will das Script im Script nicht...

Der will nicht. Explorer erzählt mir was von "nicht abgeschlossener Zeichenkonstante", dem glaub ich aber nicht weiter als ich ihn sehe.

Die Script-Zeile um die es zentral geht ist:

document.write("<a href=\"javascript:location.replace('aktu_type.jsp?clientContractId="+conID+"&CRT_SID="+crtsidArr+"&CRT_POSITION='+document.contentType.CRT_POSITION_"++".value');\">");

Vielleicht kann man es sich jetzt etwas besser vorstellen?

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

<STRONG>Der will nicht. Explorer erzählt mir was von "nicht abgeschlossener Zeichenkonstante", dem glaub ich aber nicht weiter als ich ihn sehe.

Die Script-Zeile um die es zentral geht ist:

document.write("<a href=\"javascript:location.replace('aktu_type.jsp?clientContractId="+conID+"&CRT_SID="+crtsidArr+"&CRT_POSITION='+document.contentType.CRT_POSITION_"++".value');\">");

Vielleicht kann man es sich jetzt etwas besser vorstellen?</STRONG>

Da hast du wohl recht. Danke. Aber noch läufts nicht ganz.

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.