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.

Externes JS in GWT einbinden

Empfohlene Antworten

Veröffentlicht

Hi,

ich bin bei meiner Arbeit mit dem GWT auf ein weiteres Problem gestossen. Ich würde gerne ein externes js-File einbinden. Dies kann ich laut Dokumentation mit <script src="js-file"/> in der gwt.xml tun. Schreibe ich folgenden Code in das js-file


alert("Hallo");
[/PHP]

bekomme ich beim Aufruf meiner Seite, wie erwartet "Hallo" ausgegeben. Definiere ich allerdings eine Funktion in diesem js-file, also

[PHP]
function test() {
alert("Hallo");
}

und versuche nun diese Datei via JSNI aufzurufen, also durch Aufruf der folgenden Methode


public static native void test() /*-{
test();
}-*/;
[/PHP]

bekomme ich eine unbehandelte Ausnahme.

Daher die Frage: wie binde ich eine externe js-Datei so ein, dass ich darin definierte Funktionen auch aufrufen kann?

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.