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.

[JS] Popup Events

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe hier folgendes Problem:

Ich öffne ein Popup, dessen Inhalt für mich eine "BlackBox" ist. Dieses Popup ändert in meinem Formular des Openers ein Input-Hidden Feld.

Ich möchte nun irgendwie mitbekommen, wann dieses Hidden-Feld sich änder, um dessen Wert zu verarbeiten. Leider funktioniert bei Hidden-Feldern ein onChange nicht.

Nun habe ich versucht, das ganze mit dem onclose bzw onunload des Popups selbst zu machen:

function addEvent( obj, type, fn ) {

	if (obj.addEventListener) {

		obj.addEventListener( type, fn, false );

	}

	else if (obj.attachEvent) {

		obj["e"+type+fn] = fn;

		obj.attachEvent( "on"+type, obj["e"+type+fn] );

	}

}


function myInsert()

{

  hidden = document.getElementById(xyz);

  textarea.value = hidden.value;

}


pop = window.open(xxx);

addEvent(pop, 'unload', myInsert);

Das ganze funktioniert so auch, aber leider nur, wenn im popup nicht auf einen link geklickt wurde um darin zu surfen... Denn dann hat das Popup meinen "onunload" Event nicht mehr. Wie könnte ich das am besten anstellen?

Danke für alle Anregungen.

Gruß,

Markus

PS: Wie oben erwähnt, kann/darf ich den Inhalt des Popups selbst nicht ändern!

Ich kann es nur von außen via JS manipulieren...

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.