JQuery Mobile 学习笔记2-4:changePage()方法跳转页面
来源:互联网 发布:移动网络下载不了电影 编辑:程序博客网 时间:2024/05/29 10:56
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Murphy_JQueryMobile的changePage()方法跳转页面</title>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css"/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script type="text/javascript">
$(function(){
$.mobile.changePage('about.html',{
transition:'slideup'
});
});
</script>
</head>
<body>
<section data-role="page" id="el">
<header data-role="header"><h1>跳转页面</h1></header>
<div data-role="content">
<p>页面正在跳转中......</p>
</div>
<footer data-role="footer"><h4>©2013 imurphy.lofter.com</h4></footer>
</section>
</div>
</body>
</html>
about.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Murphy_JQueryMobile的changePage()方法跳转页面-about.html</title>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
</head>
<body>
<section data-role="page" id="el" data-add-back-btn="true">
<header data-role="header"><h1>关于Murphy</h1></header>
<div data-role="content">
<p>页面直接从当前页跳转到“about.html”页面中</p>
</div>
<footer data-role="footer"><h4>©2013 imurphy.lofter.com</h4></footer>
</section>
</div>
</body>
</html>
changePage()方法此方法除了可以跳转页面外,还能带数据传递给跳转的目标页,如下面代码所示
.post('../visitor/checkRegister.do',{regemail:email,
}, function(data) {
//代表邮箱已注册
if(data.data.regstatus=="true"){
//$.mobile.changePage("../front/Exhibition_mobile_login.html",{ transition: "pop" });
$.mobile.changePage('../front/Exhibition_mobile_login.html',{
data:"exhibition_id="+exhibition_id,
},
'pop',false,true
);
return false;
} 表示通过ajax实现了visitor/checkRegister.do'跳转,如果成功的话就跳转到
"pop"表示跳转时页面的效果
第一个"fasle"值表示跳转·时的方向,如果为“true“表示反方向跳转,默认值为"fasle"
第二个"fasle"表示完成跳转后是否更新历史记录,默认为"true",表示更新
说明:如果指定跳转的目标页不存在或传递的数据格式不正确时,都会在当前页面出现一个错误提示框,几秒之后自动消失,不影响当前页面的内容显示
注:当作这个demo时遇到一个问题,就是在跳转的时候出现了”error loading page“,那是jquery mobile不支持file://,也就是本地文件,所以要将其上传到服务器上运行
- JQuery Mobile 学习笔记2-4:changePage()方法跳转页面
- changePage()页面跳转方法
- jquery.mobile.changePage() 页面参数介绍
- jQuery Mobile中jQuery.mobile.changePage方法使用详解
- jquery mobile的changepage
- jquery mobile changepage无效
- jQuery Mobile-页面跳转
- jquery mobile changepage 传参问题
- jquery mobile带表单参数的changePage
- $.mobile.changePage
- jQuery Mobile页面跳转后,无法加载js中的方法
- 【jQuery Mobile学习】jQuery Mobile页面(一)
- 【jQuery Mobile学习】jQuery Mobile页面(二)
- Jquery页面跳转方法
- mobile.changePage切换页面后的事件处理
- PhoneGap/jQuery Mobile: 多页面导航跳转
- jquery mobile 页面跳转 data-id
- Jquery Mobile changePage事件实现左右滑动效果
- 黑马程序员——多线程第三天
- Canvas也能实现Map的能拖能缩放的效果
- 几种常见的内嵌数据库
- 【mfc】标签页
- Poj 2084 Game of Connections(高精度卡特兰数)
- JQuery Mobile 学习笔记2-4:changePage()方法跳转页面
- 使用服务(内置)动态填充dropdownlist
- 【HDU2639】Bone Collector II
- IP3 比1DB压缩点 大10DB
- 按时间给表建立range分区
- leetcode Search Input Position
- 汉游天下公司的一些感悟
- Poj 2251 Dungeon Master(三维Dfs)
- 关于Cocos2d-x的一些认识(2)