Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Load Page via AJAX ignores Sub-Page  #1995

Closed
@negue

Description

@negue
Contributor

If you load a Page via AJAX which has 1 or several Sub-Pages (with a hash-id) in it. Only the first with be added to the Document.

Activity

robinheghan

robinheghan commented on Jun 30, 2011

@robinheghan

Confirmed. This is kinda annoying as I do like to have separate documents for my pages, but some pages just belongs together in a single document (like a "Remove ListItem" page and a "Confirm removal" dialog/page).

toddparker

toddparker commented on Jun 30, 2011

@toddparker
Contributor

This is the way it works now for technical reasons. We can look into making this work, probably after 1.0.

smoothcontract

smoothcontract commented on Jul 23, 2011

@smoothcontract

Hi Todd,

This issue is causing me grief too. I know the recommended approach is to return just one jQm page per HTTP response but it seems overkill to issue another server round trip for something as simple as a confirmation dialog so I'd like to return both of these page parts together.

This approach works fine when I retrieve the page without ajax, but breaks (I get no dialog) when fetching via ajax so I'm currently having to disable ajax fetches for some parts of the site and so losing the nice transitions etc.

Would you accept a pull request to implement multiple pages being returned via ajax? I'm quite tempted to have a go at fixing this unless you have some other approach in mind...

toddparker

toddparker commented on Jul 25, 2011

@toddparker
Contributor

It's a more complex issue to solve than just loading in the multiple pages because we need to deal with registering and tracking these pages in the navigation script. If you want to do a deep dive and try work work this out, that would be great if you submit a pull.

tomthetree

tomthetree commented on Aug 17, 2011

@tomthetree

@smoothcontract - when you say it breaks, what happens?

I'm getting the same issue I believe: if a page fetched via ajax contains sub pages, those sub pages won't load at all if linked to from the page, via the usual jqm method of linking to the sub page's ID. Instead, the index page of the site loads again in their place.

Presumably multi page layouts are still allowed (and in turn, linking to those sub pages), even when having been fetched via ajax?

These two pages together form a test to illustrate the problem, if it's of any help:

index.html:

http://pastie.org/2386109

testPage.html:

http://pastie.org/2386111

leopd

leopd commented on Oct 7, 2011

@leopd

I'm really surprised this issue has been pushed to the back burner. It's quite confusing. The documentation implies this should work. Quoting from http://jquerymobile.com/test/docs/pages/page-links.html

jQuery Mobile is designed to work with simple page linking conventions. Essentially, you can link pages and assets as you normally would
The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.

johnbender

johnbender commented on Oct 7, 2011

@johnbender
Contributor

https://github.com/jquery/jquery-mobile/wiki/Feature-Requests

This is registered under feature requests in the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @johnbender@tomthetree@leopd@smoothcontract@toddparker

        Issue actions

          Load Page via AJAX ignores Sub-Page · Issue #1995 · jquery-archive/jquery-mobile