How to page via querystring without reloading?

Asked

Viewed 64 times

0

I list the products via a querystring as in the example: "{meusite? pg=1}"

I saw that on the site of the American and Walmart they make a pagination similar to mine, but without reloading the rest of the page.

How do I implement this on my website ?

  • You will have to use ajax every other page request, I will leave a list with demonstrations for you to follow. http://www.jqueryrain.com/2012/04/best-ajax-jquery-pagination-plugin-tutorial-with-example-demo/

2 answers

0

You will need to make a request via ajax to request for the web service only the necessary content and at runtime plot the received data. Forms of implementation exist several and everything depends on the desired result.

Ajax with jquery: http://api.jquery.com/jquery.ajax/

  • Your answer does not answer the question. Edit your answer by putting an example, explaining how it works. Links may expire over time.

  • Doesn’t really answer

-1

Friend, I’m not sure of the question. Is your doubt about the paging method without reloading the page (in this case about using the ajax that your friend Yuri answered) or prevent the browser to reload the page when you change the url parameter (when to change from meusite?p=1 to meusite?p=2)? If this is the case, I suggest using "#" anchors and javascript events (using the ajax of friend Yuri for content exchange). Researching something simple for you I found: http://joakim.beng.se/blog/posts/a-javascript-router-in-20-lines.html Still, for a better understanding, research on javascript routes. It is used in SPA applications - Single Page Application

Browser other questions tagged

You are not signed in. Login or sign up in order to post.