之间转换时,我有两页,index.html,然后testpage.html我的html页面
testpage.html由两个页面元素foo和它们之间的链接栏设置基本URL jQuery的链接怎么办。
我使用ajax调用从index.html过渡到testpage.html。问题是testpage.html上的链接正在使用index.html作为基础url。所以,当我试图从#foo去#bar我赶上pagechangefail
$(document).bind("pagechangefailed", function(event, data){
alert('failed change ' + data.toPage);
});
这提醒“未能改变http://domain.com/mobile/index.html#bar”
的问题显然是#bar不上的index.html存在,但在testpage.html上存在。我不明白为什么链接试图链接回原始页面。我如何手动设置链接或尝试以某种方式手动覆盖?我试过类似
$.mobile.changePage('testpage.html#bar');
但没有运气。