I’m making a page which shows data, which is quite enormous.Tried pagination on it but didn’t work the way I wanted. I’m looking for, something like “See more results”, which on clicking will increase size of the page. Further, is it possible to do it with some limit on content to be shown on every click, like on every click it should show, say 10 or 15 rows ?
I’m making a page which shows data, which is quite enormous.Tried pagination on it
Share
The best way to do this, in my opinion, is to cut the text and load just part of it with PHP. In this way the initial page won’t be heavy. Then with a ‘Read more…’ button you can send an ajax request (with jQuery, maybe using the function
load()function) you can get additional text, which will be appended in a div after the current text. Additionally, if you want to retrieve just some lines each time you press the button, you can check with jQuery how many div are already added (just adding a class to your new divs, you can check this just with$('#NameOfTheparent div.classOfTheNewDivs').length) and pass the variable to PHP, during the ajax request (so it won’t be$('newDiv').load('something.php')but$('newDiv').load('something.php?var=numberOfDivAlreadyLoaded').Well, this is the concept. 😛