Looking for a way to switch pages without any reloading? Here's my AJAX approach:
app.ajax.client.request = function(headers, path, method, queryObj, payload, cb) {
// Code for sending AJAX request goes here
}
Client Requests:
app.changeToIndexPage = function(e) {
e.preventDefault();
if (!app.mainContainer.hasClass('index')) {
// Code for changing page and updating content
}
If I want to go from a different page to the index page, I simply use the changeToIndexPage
function with AJAX handling the file retrieval. However, I wonder if there is a more efficient solution?