前段时间看有人做的JQuery Mobile的界面很不错,认为移动的应用也会像桌面应用一样,慢慢的都走向WEB方式.
先贴出代码吧:
- <!DOCTYPE html>
-
<html>
-
<head>
-
<meta charset="utf-8">
-
<meta name="viewport" content="width=device-width, initial-scale=1">
-
<title>LogIn</title>
-
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-
<link rel="stylesheet" href="jquery.mobile-1.0.1.min.css">
-
<script src="jquery.js"></script>
-
<script src="jquery.mobile-1.0.1.min.js"></script>
-
<script type="text/javascript">
- jQuery(document).ready(function() {
- //输入事件
- $("input[id]").bind("focus",function () {
- if($(this).attr("id")=='username'||$(this).attr("id")=='password')
- $(this).attr("value","");
- });
- //提交
- $("#submit").bind("click", function() {
- if (valid()) {
- alert("获取的用户名为:"+$("#username").attr("value")+" 密码为:"+$("#password").attr("value"));
-
var name = $("#username").attr("value");
-
var passwd = $("#password").attr("value");
- $.ajax({
- type: "POST",
- url: "http://localhost/jqm/check.xml",
- data: $("form#loginform").serialize(),
- success: function(msg){
- $(msg).find('authUserResponse').each( function (i) {
-
var login = $(this).children('return').text();
- alert(login);
- })
-
/*if(msg=='success'){
- $.mobile.changePage("content/first.html","slidedown", true, true);
- }else{
- $.mobile.changePage("content/loginfalse.html","slidedown", true, true);
- }
- */
- }
- });
- }
- });
- });
- //输入信息验证
- function valid(){
- if($("#username").attr("value")==''||$("#password").attr("value")=='')
- {
- alert('用户名或密码不能为空!');
- //$.mobile.changePage("content/loginfalse.html","slidedown", true, true);
- return false;
- }
- return true;
- };
-
</script>
-
<style type="text/css">
- p {
- font-size: 1.5em;
- font-weight: bold;
- }
- #submit{
- float:center; margin:10px;
- }
- /*#toregist{
- float:left; margin:10px;
- }*/
-
</style>
-
<body>
-
-
<section id="page1" data-role="page">
-
<header data-role="header" data-theme="b" ><h1>XXXXXX移动平台</h1></header>
-
<div data-role="content" class="content">
-
<p style="backg"><font color="#2EB1E8" >登录</font></p>
-
<form method="post" id="loginform">
-
<input type="text" name="username" id="username" value="用户名"/><br>
-
<input type="password" name="password" id="password" value="密码输入提示"/>
-
<fieldset data-role="controlgroup" >
-
<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
-
<label for="checkbox-1">保持登录状态</label>
-
</fieldset>
-
-
<a data-role="button" id="submit" data-theme="b">登录</a>
-
</form>
-
</div>
-
<footer data-role="footer" ><h1>©2012 XXXX 学苑在线BBS</h1></footer>
-
</section>
-
-
</body>
其中的那个check.xml文件如下:
- <?xml version="1.0" encoding="UTF-8"?>
-
<root>
-
<authUserResponse>
-
<return>true</return>
-
</authUserResponse>
-
</root>
大概就是介样子吧:
分享到:
相关推荐
jquery mobile界面数据刷新jquery mobile界面数据刷新
JQUERY用户登陆界面特效 JQUERY用户登陆界面特效 JQUERY用户登陆界面特效 JQUERY用户登陆界面特效
jquery精美登陆界面,运用jquery和javascript
资源名称:jQuery、jQuery UI及jQuery Mobile技巧与示例内容简介:《jQuery、jQuery UI及jQuery Mobile技巧与示例》包括jQuery、jQuery UI、jQuery Mobile以及jQuery插件四部分内容。第一部分介绍jQuery核心库,从...
jQuery Mobile是一款基于HTML5的用户界面系统,旨在使所有智能手机,平板电脑和桌面设备上都可以访问的响应网站和应用。jQuery Mobile 不仅会给主流移动平台带来jQuery核心库,而且会发布一个完整统一的jQuery移动UI...
1.jQuery Mobile 是一个用于创建移动端web应用的的前端框架。 2.jQuery Mobile 构建于 jQuery 以及 jQuery UI类库之上,如果您了解 jQuery,您可以很容易的学习 jQuery Mobile。 3.jQuery Mobile 使用了极少的 ...
jQuery mobile相册的一种样式
jQuery Mobile 是用于创建移动 Web 应用的前端开发框架。 jQuery Mobile 可以应用于智能手机与平板电脑。 jQuery Mobile 使用 HTML5 & CSS3 最小的脚本来布局网页。
利用jquery mobile 完成登录、修改、注册界面设计,帮助完成期末大作业
作为jQuery Mobile的入门级读物,《jQuery Mobile快速入门》以示例方式讲解了jQuery Mobile的基本知识和核心特性,内容系统全面,便于理解。 《jQuery Mobile快速入门》总共分为10章,内容包括jQuery Mobile的基础...
jQuery Mobile音乐播放代码 为什么使用 jQuery Mobile? 通过使用jQuery Mobile 可以 "写更少的代码,做更多的事情" : 它可以通过一个灵活及简单的方式来布局网页,且兼容所有移动设备。 lamp 不同设备使用了...
本资源以Hello Word为例,里面包含了jQuery Mobile框架所需要的部署文件。
JQUERYMOBILE 提示框 用语JQUERYMOBILE 移动开发的提示框
jQuery Mobile是jQuery在手机和平板设备上的版本,用于创建针对智能手机和平板电脑的跨设备Web应用。 jQuery Mobile旨在“为jQuery社区创建一个优雅的能够兼容当前所有主流移动平台的HTML5 UI库”。jQuery Mobile...
jQuery mobile滑动式的标题导航
jquerymobile制作的漂亮界面示例源代码
jQuery Mobile快速入门.pdf
jQuery Mobile开发的移动新闻阅读器,HTML5技术配合jQuery MobilejQuery Mobile jqm 新闻阅读器 jqm图标更换 jQuery Mobile jqm 新闻阅读器 jqm自定义按钮的图片以及header和footer的定位
jquerymobile是用于创建移动 Web 应用的前端开发框架,此资源包含了几套jquerymobile的模板,供新手学习。
jquerymobile例子 包含从登陆到菜单和各种菜单切换完整设计 上传只为分享