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

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -