Expert Developer JavaScript Question: Download Expert JavaScript Developer PDF
How can a page be forced to load another page in JavaScript?
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>
XHTML
<script language="JavaScript" type="text/javascript" >
<!-- location.href="http://newhost/newpath/newfile.html"; //--></script>
Previous Question | Next Question |
What does the isNaN() function do? | How can JavaScript codes be hidden from old browsers that don't support JavaScript? |