location.replace

ページのURLを指定されたURLに置き換えます。

構文

location.replace(URL)

例文

<html>
 <head>
  <title>location.replace</title>
  <script type="text/javascript"><!--
  function pageReplace () {
   location.replace("http://www.openspc2.org/");
  }
  // --></script>
 </head>
 <body>
 <form>
  <input type="button" value="replace" onClick="pageReplace()">
 </form>
 </body>
</html>

関連記事

スポンサーリンク

配列を読み込む

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る