Making page links work via JS instead of pageload

This commit is contained in:
Will Bradley 2014-02-26 20:07:21 -07:00
parent b86558764c
commit fed93c3550

View File

@ -851,6 +851,11 @@ if ( !class_exists( 'Simple_Map' ) ) {
}); });
} }
function loadPage( page ) {
document.getElementById('location_search_page').value = page;
searchLocations(0);
}
function searchLocations( is_search ) { function searchLocations( is_search ) {
// Init searchData // Init searchData
var searchData = {}; var searchData = {};
@ -1095,7 +1100,7 @@ if ( !class_exists( 'Simple_Map' ) ) {
// Create page links // Create page links
page_links = ""; page_links = "";
for(i=1;i<=total_pages;i++){ for(i=1;i<=total_pages;i++){
page_links += '<a href="?location_search_page='+i+'"'; page_links += '<a onclick="loadPage('+i+'); return false;" href="?location_search_page='+i+'"';
if(i == this_page){ if(i == this_page){
page_links += ' class="active"'; page_links += ' class="active"';
} }