Created
April 2, 2012 20:20
-
-
Save h4/2286946 to your computer and use it in GitHub Desktop.
Объект window.location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Перезагрузка страницы</title> | |
<script type="text/javascript"> | |
function reloadPage() { | |
window.location.reload(); | |
} | |
</script> | |
</head> | |
<body> | |
<input type="button" value="Reload page" onclick="reloadPage()" /> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Переадресация c использованием javascript</title> | |
<script type="text/javascript"> | |
function currLocation() { | |
alert(window.location); | |
} | |
function newLocation() { | |
window.location="http://www.avalon.ru/"; | |
} | |
</script> | |
</head> | |
<body> | |
<input type="button" onclick="currLocation()" value="Показать URL страницы"> | |
<input type="button" onclick="newLocation()" value="Перейти на другую страницу"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment