I have a page that has a jquery AJAX function
$(document).ready(function() {
var options = {
target: '#return',
beforeSend: function() {
$('#processing').show();
},
complete: function() {
$('#processing').hide();
$("#SymbolSearchResults tr:even").addClass("SSOdd");
$("#previous").click(function(){ changestart('back'); });
$("#next").click(function(){ changestart("forward"); });
$("#lookup").click(changestart);
}
};
$('#SymbolSearchForm').ajaxForm(options);
});
function changestart(direction)
{
var rowsElement = $("#maxrows");
var rowsValue = parseInt(rowsElement.val());
var startElement = $("#startID");
var value = parseInt(startElement.val());
startElement.val(direction == "forward" ? value + rowsValue : direction == "back" ?
value - rowsValue : 1);
}
</script>
I was having trouble rebinding the click handlers to the #next, #lookup and #previous as well as the class SSOdd to the table #SymbolSearchResults tr:even. I fixed it by adding it into the complete function. However I cannot apply any styles to the target div #return. I can style elements in the #return by ID, but again, nothing to the #return div itself. Is there a solution to this? I can only style the div by using inline CSS in the html page, not desired. I also think maybe I should use the .live function for the click functions inside the complete function? can you add a class with .live?
Please help unf**ck my code!
thx