Dynamic content

350 views
Skip to first unread message

Kieran Grant

unread,
Nov 20, 2012, 9:33:23 AM11/20/12
to gora...@googlegroups.com
I am having trouble loading dynamic content into Ratchet.

I have an Index.html and the content is loaded via Ajax. This is fine, it loads when I start up the app. The problem is when I go to the next page and then return to index.html the content does not load.

Any help with this would be great as I am pulling my hair out trying to fix this.

Thanks

Matteo Annibali

unread,
Jan 21, 2013, 8:40:09 AM1/21/13
to gora...@googlegroups.com
Use addEventListener("push") and catch the page!

Banditvibe

unread,
Nov 10, 2014, 11:48:33 AM11/10/14
to gora...@googlegroups.com
But how exactly do you cache the page? And how do you use PUSH for general purpose ajax as in updating a single div on same page?

Todd Miller

unread,
Dec 7, 2014, 12:37:32 AM12/7/14
to gora...@googlegroups.com
My guess is that your AJAX event is bound to an event like $(document).ready() or something. If that's the case, your AJAX call won't get fired when a link is clicked or when the back button is used, because the PUSH framework hijacks those events and simply replaces everything in the '.content' div with the HTML in '.content' div of the next requested page. 

So instead of (or perhaps in addition to) binding the AJAX call to the $(document).ready(), you'll want to do something like this:
window.addEventListener('push', yourAjaxCall);
Reply all
Reply to author
Forward
0 new messages