Does anyone have good suggestion of the best option for jQuery Ajax to refresh a DIV?
Following are what I\'m trying to achieve:
With an ajax call the majority of your overhead is going to come from the XHR request itself. Though you can cache your necessary objects in variables to increase performance as much as possible. Assuming your HTML is like this:
You could then use the following JS
$(document).ready(function() {
// Load our DOM objects into vars
links = $('#nav a');
contentPane = $('#contentpane');
// On click load content into pane using ajax
links.click(function(e){
contentPane.load( $(this).attr('href') );
e.preventDefault();
});
});