We have a web app, which is tab structured. When a user clicks a tab for the first time, it loads in content via .load(). This is great and works well and is relatively fast, however we want to cache the load so in future, if the user clicks the same tab as before, it doesnt load the content in, it just .show() the same content as before.
For example:
$('#link1').click(function(){
$('#holder1').load('/pages/link1');
}
How can i store that the user has loaded the content in and just show the content on next click. I need to keep it as modular and universal as possible, so not just link1, link2 etc…
Any ideas?
mmmm….
you should create an array q dictionary on your JS which is like this :
userId LinkId Content
each load you should put the value in there
and the next time you need to load something – check it first on the dictionary / qarray.