HREF不工作,如何重定向到PhoneGap的特定网页? [英] href not working, how to redirect to a specific page in PhoneGap?

查看:206
本文介绍了HREF不工作,如何重定向到PhoneGap的特定网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML5中,我去一个特定的页面以下列方式:

In Html5 I go to a specific page in the following manner:

window.location.href = "http://localhost:XXXX/MyPageName.html";

通过点击按钮上的HREF不无法正常工作!我不知道为什么,这是我能解决这个问题的唯一办法。

The href by clicking on the button does not work!! I have no idea why, it's the only way I could solve this problem.

当我运行使用PhoneGap的HTML5的应用程序,该链接不工作(很明显,因为没有本地主机应用程序)

When I run the html5 application using the PhoneGap, the links do not work (obviously, since there is no localhost to application)

我该如何解决这个问题呢?

How can I solve this problem?

推荐答案

您会使用这样的事情解决您的问题:

You will solve your problems using something like this:

<script>
    //action go to pageOther
    $.mobile.changePage('#pageOther','slide');
</script>
<body>
    <div data-role="page" id="pageHome">
        //Your html
    </div>
    <div data-role="page" id="pageOther">
        //Your html
    </div>
</body>

查看更多信息: http://jquerymobile.com/演示/ 1.2.0 /文档/页/页anatomy.html

这篇关于HREF不工作,如何重定向到PhoneGap的特定网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆