Expert Developer JavaScript Question:
Download Questions PDF

How can a page be forced to load another page in JavaScript?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

Answer:

The following code has to be inserted to achieve the desired effect:

XHTML

<script language="JavaScript" type="text/javascript" >

<!-- location.href="http://newhost/newpath/newfile.html"; //--></script>

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What does the isNaN() function do?How can JavaScript codes be hidden from old browsers that don't support JavaScript?