javascript - How to override ajax=false so it switches to loaded dom page if exists -


i have few item htmls, each of contains single jqm-page. have index page. multi-jqm-paged html, each jqm-page category listing items.

  index.html                  item1.html           item2.html   +------------------+        +--------+--------+  +--------   |+-------+         |     +--|cat.    |    next|->|cat.   ||.cont- |         |     |  +--------+--------+  |--------   ||ent    |+-------+|<----+  |                 |  |   |+-------+|#cat1  ||        |                 |  |   |         |       ||        |bla bla bla      |  |bla bla   |         |link1+---------->|                 |  |   |         |link2  ||        |                 |  |   |         +-------+|        +-----------------+  +--------   |+-------++-------+|   ||#cat2  ||#cat3  ||   ||       ||       ||   ||link4  ||link3  ||   ||       ||       ||   |+-------++-------+|   +------------------+ 

currently can link index item, smooth ajax loading. realized if want link item index#cat1, need use data-ajax='false' index multi-page html. (i can't use data-rel='back' because previous page isn't index.html).

if use ajax='false', lose smooth transition if switch between list , items (each switching list full reload). e.g.:

-full-load-> index#cat1 -ajax-load-> item2 -full-load(again)-> index#cat1

question

i want:

-full-load-> index#cat1 -ajax-load-> item2 -ajax-switch-to-already-loaded-> index#cat1

how can override jquery mobile logic when data-ajax='false' link clicked, first searches see if index#cat1 page in dom? if is, switch jqm-page. if not exist, full loading of index#cat1 without ajax (like default behaviour).

keep in mind user can start item1.html , navigate index.html#cat1.

i know need markup each jqm-page custom attributes, data-full-url="index.html#cat1" make easier search existing pages. main weakness how can change existing jquery mobile linking logic.

i have created situation in following fiddles.

1) index page: http://jsfiddle.net/nachiket/rpzw7/
2) detail item page: http://jsfiddle.net/nachiket/chmhw/ (this 1 linked in index page fiddle)

i haven't used data-ajax='false', solve problem? if not, please update fiddles exact situation,so can better.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -