if (confirm("go anywhere?"))
 location.href="1.asp";
else
 location.href="2.asp";

解决方案 »

  1.   

    if(confirm("确定了吗?"))
      window.location.href="http://www.csdn.net/";
    else
      window.location.href="http://www.163.com/";
      

  2.   

    var myarray=new Array(1,2,3,4)
    for(i=0;i<=myarray.length-1;i++)
        if(myarray[i]==2) 
            if(confirm("是2了,你要跳转吗?"))
               location.href="yourlinkone"
            else
               location.href="yourlinktwo"