2011-08-10 39 views
0

我有两页,第一种叫index.html并有一个登录按钮与此代码更改页面conexion.html问题URL jQuery Mobile的按钮首页

$('#page').live('pagecreate',function(event){ 
    $("#login").bind("click", function(event) { 
     $.mobile.changePage("conexion.html",{ transition: "flip"}); 
    }); 
}); 

的URL更改

http://localhost/mobile/olapromo/#/mobile/olapromo/conexion.html

在 “connexion.html”

我回电话 “的index.html”,此代码:

<a href="index.html" data-icon="home" data-iconpos="notext" class="ui-btn-right jqm- home">Home</a> 

,当我的主屏幕按钮点击URL变化

http://localhost/mobile/olapromo/#/mobile/olapromo/index.html

,我无法访问conexion.html更多

+0

如果您有多个问题,请发表两个独立的问题 –

+0

我有编辑 –

回答

0

你什么意思,你可以再次访问conexion.html?你的意思是当你点击登录按钮什么都没有发生?

如果是这样的话;

您正在使用的pagecreate处理程序在哪里定义?它是在页面中还是像在document.ready处理程序中?

考虑将.bind更改为.live,看看是否有效。

+0

我把这个,但它不工作$(“A”)。住(“点击”,函数(事件){$ 。 mobile.changePage(“index.php”,{transition:“flip”}); }); –

+0

你可以在jsfiddle.net上做一个例子吗?您似乎无法提供有关“无法访问”的更多信息。有没有JavaScript错误?它说“错误加载页面”?什么都没有发生?粉红色的大象在你的屏幕上转储吗?我什么也没得到。 – Jacob