php - Javascript location doesn't work -


here code.

echo"<button class='buttonajax' onclick='javascript:location = try.php;'>go back</button>"; 

i tried redirect page through button not perform function.

please tel me problem in code?

you need wrap location you’re sending user in quotes because otherwise javascript try interpret variable name:

echo"<button class='buttonajax' onclick='javascript:location = \'try.php;\''>go back</button>"; 

Comments

Popular posts from this blog

android - Automated my builds -

python - How to return the most similar word from a list of words? -

apache - GeoServer under https -