Forum Moderators: open

Message Too Old, No Replies

document.location.href not working

         

strings

5:27 am on Jun 6, 2008 (gmt 0)

10+ Year Member



on submitting the form i am calling the javascript function. The function is getting called, the problem is document.location.href is not working .
plz anyone get some solution.
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
function mailno($no, $textname)
{
alert("functi called") ;
document.location.href="http://www.yahoo.com";
}
</SCRIPT>

thks
amit.

rocknbil

5:00 pm on Jun 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Because location.href is a window object, not document. Try just location.href, or window.location.href.

Previous resource [webmasterworld.com]