0

这是我的代码

<!DOCTYPE html> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script>
function loginProcess()
{
    $.ajax({
        type: 'GET',
        url: 'loginProcess.php',
        data:
        {
            uname:$("#userName").val(),
            pass:$("#pass").val(),
            rem:$("#remVal").val()
        },
        cache: false,
        success: function(data)
        {
            if(data == 1)
            {
                location.href="home.php";
            }
            else
            {
                location.href="index.php";
            }
        }
        });
}
function ckLogin(e)
{
    if(e.keyCode == 13)
    {
        loginProcess();
    }
}

      <li>
            <font size="1px"> Username: </font>
            <input type="text" id="userName" name="userName" value="kamalesh" onKeyUp="ckLogin(event);" required="required" />
      </li>

      <li>
          <font size="1px"> Password: </font>
          <input type="password" id="pass" name="pass" value="kamalesh" onKeyUp="ckLogin(event);" required="required" />
      </li>

      <li>
            <span><font size="1px"> Remember me: </font></span>
            <select data-role=slider id="remVal">

              <option value=no> No </option>

              <option value=yes> Yes </option>

            </select>
      </li>

      <li><input type="button" value="LogIn" onClick="loginProcess();"/></li>
    </ul>
    </form>
</div>
</div>
</body>

</html>

http://jsfiddle.net/DeJzZ/210/

4

1 回答 1

2

在 head 标记中使用此代码段


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
于 2013-06-10T10:15:25.307 回答