window.locationを使用してJavaScriptで別のURLにリダイレクトする方法は?
例
次のコードを実行して、window.locationを使用して別のURLにリダイレクトする方法を学ぶことができます。ここでは、ホームページにリダイレクトします
<html>
<head>
<script>
<!--
function Redirect() {
window.location.assign("https://www.tutorialspoint.com");
}
//-->
</script>
</head>
<body>
<p>Click the following button, you will be redirected to home page.</p>
<input type = "button" value="Redirect Me" onclick="Redirect();" />
</body>
</html> -
JavaScriptでフルスクリーンウィンドウを作成するにはどうすればよいですか?
JavaScriptでフルスクリーンウィンドウを作成するためのコードは次のとおりです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <style> body{ font-family: 'Segoe UI', Tahoma, Ge
-
JavaScriptを使用して別のWebページにリダイレクトする方法は?
JavaScriptを使用して別のWebページにリダイレクトするには、コードは次のとおりです- 例 <!DOCTYPE html> <html> <head> <h1>Redirect to a Webpage Example</h1> <button class="redirectBtn">Redirect</button> <h2>Click the above button to Redirect to another Webpage</h2> <scri