In Javascript, how to redirect another page from the current page?

 Posted by Vivek.Ramapuram on 8/5/2014 | Category: JavaScript Interview questions | Views: 1836 | Points: 40

Here in javascript, we should use location.href that should be done by alert method. If we want to get the current url of the web page from this we can set location.href if we want to redirect current page in to another page.

<script type="text/javascript">

function TestFunction(){
<input type="Button" id="btntest" onclick="TestFunction()" value="clickme"

Asked In: While Learning | Alert Moderator 

Comments or Responses

Login to post response