how can you go about making a simple redirect script with javascript(no jquery needed) to rediret from one webpage to another?
header('Location: http://www.myredirectwebpage.com/');
but with javascript?
how can you go about making a simple redirect script with javascript(no jquery needed) to rediret from one webpage to another?
header('Location: http://www.myredirectwebpage.com/');
but with javascript?
Here is a simple way of redirecting a webpage and no jquery is needed!!
<html>
<head>
<script>
function redirect() {
window.location.assign("http://www.mywebsiteurl.com")
}
</script>
</head>
<body>
<input type="button" value="clik here ... redirect" onclick="redirect()">
</body>
</html>
<script>
window.location.href = 'http://www.myredirectwebpage.com/';
</script>
Here is a simple way to redirect from webpage1 to webpage2
<input type='button' onclick='Redirect()' value='Redirect To WebPage2' />
<script type='text/javascript'>
function Redirect()
{
window.location = 'http://www.webpage2.com';
//-- You can also use window.location.href = 'http://www.webpage2.com';
}
</script>