0
I have the following script on a page:
<script>
function fnPage(){
var page = prompt("Para quel página deseja ir?");
if (page != null) {
location.href="http://" + page;
}
}
</script>
When I fill in with the O popup address it usually appears with space to fill in with an address, but the redirect does not work when I click OK. Does anyone know where the mistake is?
Try
window.location.href
– LLeon
@Leonklaj many attributes of
window
can be accessed without callingwindow
in fact.– Giovane