jQuery Ajax - Refresh data in the DIV with pagination -
i need on refreshing data inside div. have div loads ajax page populates data in table format. when user searches companyname, triggers , refreshes data inside div, , working fine. however, ajax page has pagination (previous | next ...). if user clicks on previous|next link, jump ajax page.
is there jquery or ajax trick perform pagination within div result data feedback ajax? user clicks in the link ajax data (in div) , refresh ajax data without jump actual ajax page?
jquery codes:
$('#companyname').on('keypress', function(e) { if (e.keycode == 13) { //alert("found"); e.preventdefault(); $.ajax({ method: 'post', data: $('#form1').serialize(), url: 'ajaxpurchaserequestlist.asp', success: function(res) { $('#resulttest').html(res); } }); } });
the asp codes in ajax page. show previous|next links, , when use click link, send url "?pagenum=x".
if abspage = 1 response.write "<span style=""color:silver;"">previous page</span>" else response.write "<a href=""" & request.servervariables("script_name") & "?pagenum=" & abspage - 1 & """>previous page</a>" end if response.write " | " if abspage < pagecnt response.write "<a href=""" & request.servervariables("script_name") & "?pagenum=" & abspage + 1 & """>next page</a>" else
thank you,
Comments
Post a Comment