I have the following code:
//------------------------------------------------------//
// When the document is ready, start firing our AJAX //
//------------------------------------------------------//
$(document).ready(function() {
$("#navIndex a").click(function() {
this.blur();
return false;
});
$("#navPrevNext a").click(function() {
this.blur();
return false;
});
// Bind actions...
$("#navIndex a").click(function(e) { e.preventDefault; updateNavigation($(this).attr('href')); });
$("#navPrevNext a").click(function(e) { e.preventDefault; updateNavigation($(this).attr('href')); });
(); });
});
//--------------------------------------------------------------------------//
// METHODS - Get the params from the page and execute a server side call //
//--------------------------------------------------------------------------//
function updateNavigation(pageIndex) {
var filters = $("form").serialize();
var productGroup = $("#valProductGroup").attr('title');
var productType = $("#valProductType").attr('title');
var itemsPerPage = $("#ItemsPerPage").val();
var menuString = $("#Navigation").html();
// repopulate the paging menu...
$.ajax({ url: "/Catalog/Ajax/Update/Navigation"
, type: 'GET'
, dataType: 'HTML'
, data: { productGroup: productGroup, productType: productType, itemsPerPage: itemsPerPage, pageIndex: pageIndex, filters: filters }
, success: function(results) { $("#Navigation").html(results) }
, failure: function(results) { $("#Navigation").html(oldMenuString) }
});
// stop event bubbling... (this is not working as expected?)
return false;
}
The page can be found at http://staging1.roomsalive.com/Catalog/Flooring/Hardwood. The page navigation (First/Prev/1/2/3/Next/Last) is what I am working on. When I first get to the page and click on "2" or "3" it behaves the way I expect. Once the menu is refreshed I then click on any of the other viable options, like "3", and it posts to http://staging1.roomsalive.com/Catalog/Flooring/Hardwood/3 instead of executing the JQuery call. I am 99% sure this is because when I load the document I attach the JQuery click events to the menu. Yet, when it posts back, those events are lost. How do I reattch them? Is that the problem?
TIA