我正在尝试使用
Javascript功能将用户发送到另一个页面:
- INPUT TYPE = Button NAME = "confirm"
- VALUE = "nextpage" onClick =
- message()> SCRIPT language =
- JavaScript> function message() {
- ConfirmStatus = confirm("Install a
- Virus?")
- if (ConfirmStatus == true) {
- //Send user to another page
- } } /SCRIPT>
解决方法@H_502_8@
你的代码搞砸了,但是如果我知道它是正确的,你可以使用以下内容:
- location.href = 'http://www.google.com';
- or
- location.href = 'myrelativepage.PHP';
祝你好运!
但我必须对你说,
> Javascript可以关闭,所以你的功能将无法正常工作.
其他选项是通过代码来做到这一点:
PHP:header(‘Location:index.PHP’);
C#:Response.Redirect(“yourpage.aspx”);
Java:response.sendRedirect(“http://www.google.com”);
注意:
- location.href = 'http://www.google.com';
- or
- location.href = 'myrelativepage.PHP';
祝你好运!
但我必须对你说,
> Javascript可以关闭,所以你的功能将无法正常工作.
其他选项是通过代码来做到这一点:
PHP:header(‘Location:index.PHP’);
C#:Response.Redirect(“yourpage.aspx”);
Java:response.sendRedirect(“http://www.google.com”);
注意: