Benutzer3522457
Diese Frage hat hier bereits Antworten :
Wie leite ich auf eine andere Webseite um?
(58 Antworten)
Abgeschlossen Vor 8 Jahren .
In Betracht ziehen:
$('.b').click(function(){
var link = 'www.yahoo.com';
window.location.href(link);
});
Ich erwarte, dass es www.yahoo.com öffnet, aber es sagt “String ist keine Funktion”. Wieso den?
jsFiddle: http://jsfiddle.net/V9Xat/
Sahil Mittal
Versuchen-
window.location.href = link;
oder
window.location.assign(link);
JSFiddle
Sehen Sie sich die Syntax von an window.location hier .
Yaje
Versuchen Sie es mit:
window.location.href = link;
MDN-Quelle
window.location.href = link;
Benutze das.
Jai
Verwenden Sie entweder:
window.location.href = link;
Oder mit .replace();
:
window.location.replace(link);
128390 0 0 cookie-check String ist keine Funktion für die Fensterposition href [duplicate] yes
stackoverflow.com/questions/503093/…
– Govind Singh
9. Juli 2014 um 9:54 Uhr