Friday, January 26, 2018

Write a program for redirect the browser to a new page in javascript.

The window.location.assign() method loads a new document.

The window.location object can be used to  redirect the browser to a new page.

Program
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function abc()
{

window.location.assign("https://www.w3schools.com");
}
</script>
</head>
<body>
<h1>Java</h1>
<h2> Documents</h2>
<input type="button" value="Load Document" onclick="abc()">
</body>

</html>

Output



0 comments:

Post a Comment

Thanks For Commented.

TechTalk