Results 1 to 3 of 3

Thread: Redirect

  1. #1
    Join Date
    Dec 1969

    Default Redirect

    I am using following script in my my call t.asp <BR>in script i am using if condition which says if pagenum=11 then <BR>redirect to "default.asp" <BR>else <BR>submit form1 <BR>i set timer of 20 seconds when timer expires this script is called <BR>Problem is that when i load t.asp pagenum not equall to 11 but still script redirect page to default.asp <BR>Can some one help me <BR><BR>&#060;script Language="JavaScript"&#062; <BR>&#060;!-- <BR>function startclock() <BR><BR>{ <BR>pagenum = &#060;%=iPageCurrent+1%&#062; <BR><BR>if (pagenum = 11) <BR>document.location.href="default.asp" <BR>else <BR>setTimeout(&#039;document.form1.submit()&#039; ,20000) <BR><BR><BR>} <BR><BR><BR>//--&#062; <BR>&#060;/script&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Redirect

    When you are comparing in Javascript you need to use a double equal sign ie. ==<BR><BR>In javascript "pagenum = 11 " assigns 11 to the variable pagenum.<BR>I think what you want to do is check if the pagenum is 11 then you need to write "pagenum == 11".<BR><BR>I think this may help,<BR>Donnacha

  3. #3
    Ada Guest

    Default RE: Redirect

    That certainly worked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts