作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 jQuery Mobile 的新手,经过几个小时的寻找后我没有找到解决方案。
我有两个页面,第一个页面有一个表单,当您单击“发送”按钮时,会转换到其他页面。在第二页中,我有一个新表单,但在页面转换后它不起作用。但是,如果我使用 URL 直接从导航栏进入第二页,则第二种形式可以完美运行。
当使用changePage()方法从第一个页面加载第二个页面时,它不会执行任何操作。
为了测试它,我在第一页中有以下代码:
<a data-icon="home" id="botonLogin" data-theme="a" data-role="button">Entrar</a>
这段代码用于处理点击事件:
$("a#botonLogin").bind("click", function(event) {
$.mobile.changePage( "busqueda.php", { transition: "flip"} );
});
最佳答案
我是这样解决的:
$('div#busqueda').bind('pageshow',function(event, ui){
//The code of the second page here.
}
关于jquery - jQuery Mobile 中的页面转换后脚本不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9292971/
我是一名优秀的程序员,十分优秀!