0

I was wondering how you can handle files with variables in the url like

www.mysite.com?id=myvariable

I can't possibly have to store every possibility? I used these variables because when the users are online they should be able to share their social media.

Kind regards

Toon Van Dooren
  • 613
  • 1
  • 12
  • 27

1 Answers1

2

If you want these pages to work offline as is then yes, you have to store every possibility. You surely can't expect the browser to guess what all the possibilities are?

If you want to use dynamic data in your offline app then request it with AJAX and keep it in local storage. Don't store your data in pages, keep the pages static.

If you need to have bookmarkable URLs for different bits of your app that use different data on the same page then use the History API.

robertc
  • 74,533
  • 18
  • 193
  • 177
  • I alrdy used localstorage for this, the problem is then that the url remains the same and the social media always refer to the same page.. but still something to think about! :) i could pass it trough localstorage as well as the url tough good idea :) – Toon Van Dooren Jun 22 '12 at 10:53