Here is the scenario that I have to solve,
- There are two views in the page.
- The first view is loaded initially.
- The data for second view is loaded only when the user clicks on the second view.
Problem:
- The user clicks on the second view.
- The ajax request takes time to respond.
- The user so goes back to the first view.
- Now the ajax request's callback is called.
- The user is currently in first view but the content is of the second view's.
How do I handle this scenario?
Are there any generic ways to fix such problems or should it be fixed on a case by case scenario.