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

Load Page via AJAX ignores Sub-Page #1995

Closed
negue opened this issue Jun 30, 2011 · 7 comments
Closed

Load Page via AJAX ignores Sub-Page #1995

negue opened this issue Jun 30, 2011 · 7 comments

Comments

@negue
Copy link
Contributor

negue commented Jun 30, 2011

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.

@robinheghan
Copy link

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
Copy link
Contributor

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

@smoothcontract
Copy link

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
Copy link
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
Copy link

@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
Copy link

leopd commented Oct 7, 2011

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
Copy link
Contributor

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

This is registered under feature requests in the wiki.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants