qq_40635319 2017-11-27 09:25 采纳率: 0%
浏览 874

关于网站登录判断跳转问题

图片说明
jQuery(document).ready(function() {

$('.page-container form').submit(function(){
    var username = $(this).find('.username').val();
    var password = $(this).find('.password').val();
    if(username == '') {
        $(this).find('.error').fadeOut('fast', function(){
            $(this).css('top', '27px');
        });
        $(this).find('.error').fadeIn('fast', function(){
            $(this).parent().find('.username').focus();
        });
        return false;
    }

    if(password == '') {
        $(this).find('.error').fadeOut('fast', function(){
            $(this).css('top', '96px');
        });
        $(this).find('.error').fadeIn('fast', function(){
            $(this).parent().find('.password').focus();
        });
        return false;
    }
    if (username=="1024" &&  password=="1024") {
        location.href="BirthdayCake.html";
        return;
    };

});

$('.page-container form .username, .page-container form .password').keyup(function(){
    $(this).parent().find('.error').fadeOut('fast');
});

});
我想在里面改用户名密码,然后跳转到下一个网页,请问怎么修改。

  • 写回答

3条回答 默认 最新

  • xiaokanxingchen 2017-11-27 10:43
    关注

    不太懂呢,是使用特定的用户名密码跳特定的链接吗?
    if (username=="1024" && password=="1024") {
    location.href="BirthdayCake.html";
    return;
    };
    把return去掉或者改成return true;

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作