Here's my code:
$(document).ready(function () {
var default_var = 2;
var show_var = default_var;
var total_var = 8;
var increment_var = 2;
var start_var = show_var+1;
var end_var = show_var+increment_var;
$("a[rel=more]").live("click", function(){
$("#timeshare-listings li:last").after("<li class='ajax'></li>");
$("#timeshare-listings li.ajax").load("http://www.goodbuytimeshare.com/listings/ajax/"+start_var+"/"+end_var+"/");
$("#timeshare-listings li.ajax").removeClass("ajax");
var show_var = end_var+1;
return false;
});
});
The first time I click the button it does exactly what I want. Unfortunately, for some reason, show_var
never changes its value. Why not? What do I have to do to make it change?