Cuchi
Cuchi

Reputation: 1

windows.location.href doesn't work

I have a little trouble with javascript.

This is the search box :

<input id="lala" onkeypress="lala(event)" />

This is the script :

<script type="text/javascript">
function lala(e){
    tecla = (document.all) ? e.keyCode : e.which;
    if(tecla==13) windows.location.href = 'http://server:100/Theme/resumenInstrumento.aspx?nemo=lan';
} 
</script>

When do a javascript alert, it appears well, but I cant go to URL.

Upvotes: 0

Views: 1558

Answers (2)

Jaime Garcia
Jaime Garcia

Reputation: 7096

You should be able to just do window.location = "....";

Upvotes: 2

Jakob
Jakob

Reputation: 24360

It should be window, not windows:

window.location.href = ....

Upvotes: 7

Related Questions