WordPress-jQuery-mobile-and-Phonegap-app-for-iOS
WordPress-jQuery-mobile-and-Phonegap-app-for-iOS copied to clipboard
Using Two ajax requests in a single Page
Hi @abachuk , First of all Thanks for the great source! If you check the following link, there is a scroll above and post list below, Both will work on different query, I tried using different ajax requests, But the issue, the local storage data resets after next request starting @index from 0. How can I manage this, Please advise. http://topfreemixtapes.com/mobiletest/
Thanks!
you can store data from each request in separate localStorage keys. $.ajax({url: '/posts'}).success(function(data){ localStorage.setItem('posts', JSON.stringify(data)); });
$.ajax({url: '/pages'}).success(function(data){ localStorage.setItem('pages', JSON.stringify(data)); });