Я на главной странице, и мой JavaScript включен. Теперь, что я сделал, я отключил JavaScript и обновил страницу home.php
, после чего страница перенаправляется на страницу javascript-disabled.php
, потому что я добавил метатег с URL. Здесь нет проблем.
Моя проблема,
Я на javascript-disabled.php
и включаю JavaScript и обновляю страницу, но она не перенаправляет на предыдущую страницу.
Это мой URL, когда отключен JavaScript.
http://localhost/example/javascript-disable.php
После включения JavaScript и обновления страницы
Я получил этот URL http://localhost/example/undefined
Я добавил
<script type="text/javascript">
window.location.href = window.history.back();
</script>
home.php
<!DOCTYPE html>
<html>
<head>
<title>home</title>
<noscript><meta http-equiv="refresh" content="0; url=javascript-disable.php" /></noscript>
</head>
<body>
<div>
<!--content her-->
hi
</div>
</body>
</html>
Javascript-disable.php
<!DOCTYPE html>
<html>
<head>
<title>Javascrit disable</title>
</head>
<body>
<div>
<h2>Javascript is disabled.</h2>
<p>Please enable javascript and refersh the page.</p>
<p>To unable to javascript click <a href="#" target="_blank">here</a></p>
</div>
<script type="text/javascript">
</script>
<script type="text/javascript">
window.location.href = window.history.back();
</script>
</body>
</html>