且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

window.location会无法正常工作

更新时间:2022-06-11 23:28:25

黑莓OS 5 的浏览器有很多的问题。起初我还试图做你现在正在做什么。但后来我想,所以你将不得不考虑一些其他的办法,这是更好。这是我如何解决它。

This Blackberry OS 5 browser has lots of issue. Initially i also tried to do what you are doing right now. But later i think so you will have to think of some other approach which is better. Here is how i solved it

首先添加这些行加载这样的jQuery的移动脚本之前

First of all add these lines before loading the jquery-mobile script like this

<script type="text/javascript">
    $(document).bind("mobileinit", function() {
        $.support.cors = true;
        $.mobile.allowCrossDomainPages = true;
    });
</script>

然后我用在单一的HTML概念。在这个概念,我不得不载入我的剧本只有一次,我可以利用的jQuery移动的 changePage 。当我有很多的HTML页面,然后我必须等待几秒钟加载和脚本卸载发生。避免这种情况,其unnecessarry。

Then i used the Single Html concept. In this concept i had to load my script just once and i could make use of jquery-mobile's changePage. When i had many html pages then i has to wait for some seconds as loading and unloading of scripts took place. Avoid that, Its unnecessarry.

与在相同的HTML像这样的所有页

Have all the pages with in the same Html like this

<div data-role="page" id="page1">
<div data-role="page" id="page2">
.
.
.

在那之后,你可以轻松地做一个 changePage 像这样

$.mobile.changePage("#page1", {
    transition : "slide"
});

我希望你采取正确的方法。

I hope you take the right approach.