zoukankan      html  css  js  c++  java
  • 使用ajax的登录页面

    js判空
    <script src="http://www.cnblogs.com/styles/jquery-1.4.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    
    $("#login").click(
    function()
    {
    var loginid=document.getElementById("txtloginid");
    var psw=document.getElementById("txtpsw");
    if(loginid.value=="")
    {
    alert("请输入您的用户名!");return;
    }
    if(psw.value=="")
    {
    alert("请输入您的密码!");return;
    }
    $.get("http://www.cnblogs.com/common/LoginAjax.aspx?loginid="+loginid.value+"&psw="+psw.value+"&sitecode=cmjjjc", function(data){
    if(data!="0")
    {
    $("#loginform").css("display","none");
    $("#resultForm").css("display","block");
    $("#userTD").html(data);
    loginid.value="";psw.value="";
    window.location.href="http://www.cnblogs.com/cmjjjc_xxbs/List/index.htm";
    
    }
    else
    {
    alert("您输入的用户名或者密码错误!");
    }
    }); 
    }
    );
    设计
     <table width="1002px" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
            <tr>
                <td style="padding-top: 2px;">
                    <table width="1000" height="28" border="0" cellpadding="1" cellspacing="0" class="K_01">
                        <tr>
                            <td width="106">
                                <img src="../images/login.gif" width="106" height="26" /></td>
                            <td width="502" style="padding-left:5px;">
                                <table id="loginform" width="440" border="0" cellspacing="1" cellpadding="1">
                                    <tr>
                                        <td>
                                            用户名:</td>
                                        <td>
                                            <input id="txtloginid" type="text" name="textfield4" style=" 120px;" /></td>
                                        <td>
                                            密 码:</td>
                                        <td>
                                            <input id="txtpsw" type="password" name="textfield2" style=" 120px;" /></td>
                                        <td width="10%">
                                            <img src="../images/dl.gif" width="48" height="22" style="cursor:hand;" id="login" /></td>
                                    </tr>
                                </table>
  • 相关阅读:
    网络流24题-分配问题
    网络流24题-圆桌问题
    git ssh
    SQL Server 添加说明 语句
    问题思路
    数据库事务和锁
    Castle Windsor
    Flask学习笔记11之特殊的装饰器
    python中的"环绕通知"
    Flask学习笔记10之flash
  • 原文地址:https://www.cnblogs.com/652769324qq/p/2998387.html
Copyright © 2011-2022 走看看