「JavaScript」document.locationのサンプル
説明
Document.location は読み取り専用のプロパティで、この文書の URL に関する情報を持った Location オブジェクトを返します。
使用例1
document.location = 'http://www.arkgame.com' ;
document.location = 'http://www.arkgame.com' ;
document.location = 'http://www.arkgame.com' ;
使用例2
<input type="button" value="作成" onclick="document.location.href='createuser.do?no=110'">
<input type="button" value="作成" onclick="document.location.href='createuser.do?no=110'">
<input type="button" value="作成" onclick="document.location.href='createuser.do?no=110'">
使用例3
<script>
function funcA(){
var cft = document.location;
console.log(cft);
}
</script>
<input type="button" value="テスト" onclick="funcA();">
<script>
function funcA(){
var cft = document.location;
console.log(cft);
}
</script>
<input type="button" value="テスト" onclick="funcA();">
<script> function funcA(){ var cft = document.location; console.log(cft); } </script> <input type="button" value="テスト" onclick="funcA();">