Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Telefonnummer anzurufen, eine SMS an eine Telefonnummer zu senden oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Learn More

location.assign('') not same as location.assign('/')

more options

location.assign('/') takes me to home page of site location.assign() does nothing (MS edge goes to home page) Not sure which is right, but would like consistency between browsers, for now using location.assign('/')

location.assign('/') takes me to home page of site location.assign('') does nothing (MS edge goes to home page) Not sure which is right, but would like consistency between browsers, for now using location.assign('/')

Alle Antworten (5)

more options

https://developer.mozilla.org/docs/Web/API/Location/assign says if you don't supply a valid URL, the browser will throw a syntax error.

more options

Not sure, one browser says it is OK Firefox says not

more options

I suggest using MDN and the caniuse site for cross-browser compatibility information.

more options

Could you give me specific URL names?

more options

MDN is the site I linked to before, Mozilla Developer Network.

caniuse: https://caniuse.com/