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 Zusammen, 

ich habe ein Problem, wo ich gerade nicht weiter komme. 

Ich habe diese JavaScript leere funktion: 

function psaZumWarenkorb(url, suchbegriff="",gruppe1="",gruppe2="",gruppe3=""){

}

Unter dem Chrome wird diese Funktion einwandfrei aufgerufen und ausgeführt. 

Beim IE erscheint in der Debuggerkonsole diese Fehlermeldung: SCRIPT1006: ')' erwartet

Wenn ich die default-Initialisierung (="") bei suchbegriff, gruppe1, gruppe2, gruppe3 entferne funktioniert es. Allerdings möchte ich ja, dass die Variablen, sofern keine Werte mitgegeben werden einen Leeren String beinhalten. 

Hat jemand eine Idee woran das liegen könnte? 

Ein einfacher Workaround wäre (https://stackoverflow.com/a/894877/3595565)

function foo(a, b) {
  a = typeof a !== 'undefined' ? a : 42;
  b = typeof b !== 'undefined' ? b : 'default_b';
}
vor 18 Minuten schrieb pr0gg3r:

@murat1895

Du könntest Babel (und ggf. noch ein Polyfill) verwenden, um euren Code abwärtskompatibel mit niedrigeren ES-Versionen zu machen. Am besten auch einen Bundler wie z.B. Webpack verwenden, mit dem man das automatisch machen kann.

Wenn das was du da machst umfangreicher ist, würde es sich sicher lohnen sich die hier genannten Stichworte mal genauer anzusehen @murat1895

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.