Coder Social home page Coder Social logo

jquery-mobile-plugins's People

Contributors

jblas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-mobile-plugins's Issues

Work around for refresh/first time load with query string values (multiple page)

Problem is when you try to bookmark a page with a query string value the system ignores the query string and just loads the initial page, ie:

someurl.com/#myPage?id=123

So I've come up with a work around that seems pretty solid with some basic testing so far, just wanted to share this and get feedback to see what thoughts are. Since it requires binding to the mobileinit event, it needs to be in a separate script before the jquery mobile include:

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
    var _forceChange = null;

    $(document).bind("mobileinit", function (e, data) {
        var checkRoute = location.hash;
        if (checkRoute.indexOf('#') > -1 && checkRoute.indexOf('?') > -1)
            _forceChange = checkRoute;
    });

    $(document).bind("pagebeforechange", function (e, data) {
        if (_forceChange) {
            var redirect = _forceChange;
            _forceChange = null;
            $.mobile.changePage(redirect);
            e.preventDefault();
        }
    });
</script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script type="text/javascript" src="scripts/jqm.page.params.js"></script>

Plugin does not work on first page load

I've noticed that the plugin binds to pagebeforechange - this means that page changes initiated from a jQM control or via $.mobile.changePage() work fine, but a direct page refresh / load using query string params will not work.

For example, say I have a page:

http://domain.com/index.html#lobby?user=1234

The following will work fine:

$.mobile.changePage('#lobby?user=1234')

But trying to bookmark / refresh the page, as the pagebeforechange event never fires on initial page load, the plugin can't parse the query string.

Perhaps a quick/easy fix would be to bind to both pagebeforecreate and pagebeforechange, to catch both cases?

page param doesn't work?

I used this page-param but it doesn't work.

when I visit "#shop?id=100", the URL is supposed to be "#shop" and with "id=100" stored in data. However, browser shows that URL is still "#shop?id=100" and the query string is not stored in data.

I tried to figure out if there's anything wrong, and I found that:

when changePage() is called, if the URL is string, it will call loadPage(). BUT, when loadPage() sees there are data in settings.data, it will reconstruct the URL by adding the query string back, which is just a reverse operation of this plugin

I am using jquery mobile 1.1.0-rc.1. I'm not sure if I was right about this. Please help to take a look and reply. Thanks :-)

jQM 1.3.0 rc1 and page-params plugin

I've just updated my app to jQM 1.3.0 rc1 and page-params plugin doesn't work anymore: no params in queryString, so backbuttons have unexpected results

Does this plugin work for single page templates?

Whilst the plugin works fine for multipage templates I cannot get it to work for single page templates (where you have an individual html file for each page). Since there is no readme or support details I though I'd ask here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.