2016-09-23 7 views
0
<!DOCTYPE html> 
<html> 
<head> 
<script> 
//if i put window.location= "index.php" here not inside js function it worked but I need it to be inside a function 
function newLoad() { 
    window.location= "index.php" 
} 
</script> 
</head> 
<body> 

<input type="button" value="press here" onclick="newLoad()"> 

</body> 
</html> 

any Ideen, wie kann ich es in der Javascript-Funktion arbeiten lassen?window.location funktioniert nicht innerhalb der js-Funktion

+3

Definieren Sie _nicht working_ !! –

+0

verweist nicht auf index.php –

+0

Ihr Code sollte laufen, was ist also anders? – epascarello

Antwort

0

Ihr Code funktioniert. Howether, Sie müssen kein Javascript verwenden.

<a href="index.php"> 
    <button>press here</button> 
</a> 
Verwandte Themen