WordPress-jQuery-mobile-and-Phonegap-app-for-iOS icon indicating copy to clipboard operation
WordPress-jQuery-mobile-and-Phonegap-app-for-iOS copied to clipboard

Using Two ajax requests in a single Page

Open aspradeep88 opened this issue 11 years ago • 1 comments

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!

aspradeep88 avatar Aug 08 '13 05:08 aspradeep88

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)); });

abachuk avatar Aug 18 '13 16:08 abachuk