So I’ve got some pagination working, but there’s a variable I need access to (total pages). When I get the data to display in the table from changing the page (or otherwise updating the table), what’s a good way to get the variable in the same request?
Share
If your data is being transfered in some well defined form like XML or JSON, you can simply add an extra parameter to your output.
$.postcan be configured to decode the server’s response as XML or JSON via the last parameter.Using JSON, your client code might look something like this:
And (assuming PHP on the server-side) you’d output your JSON data thusly: