When you flip the page, only the data in the specified DIV in the page is refreshed, while other div on the page does not move ....

Source: Internet
Author: User
When you flip the page, only the data in the specified DIV in the page is refreshed, while other div on the page does not move .... there is a requirement that only the data in the specified DIV in the page is refreshed during page turning, while the other p on the page does not move .... urgent, online ............ in addition, I flip pages like this
  • Homepage
  • Will refresh the whole page


    Reply to discussion (solution)

    The best way to avoid refreshing the entire page is to use ajax.

    Click the Flip button and use ajax to submit the query conditions and selected page numbers to PHP and PHP for query. after combining the results, return to the front-end JS, process the returned data, and replace the specified DIV.

    The best way to avoid refreshing the entire page is to use ajax.

    Click the Flip button and use ajax to submit the query conditions and selected page numbers to PHP and PHP for query. after combining the results, return to the front-end JS, process the returned data, and replace the specified DIV.
    I do it with my projects, and there are two pages in a template, while my paging data is in the common. func. the value returned by the function written in php in the template .... according to my requirements, how should I write ajax without refreshing pages .... it is best to paste the code for your own research...

    My paging data is the value returned by the function written in common. func. php in the template.

    Is the returned html rendered? It is better to get this html and insert it directly to the corresponding location.

    My paging data is the value returned by the function written in common. func. php in the template.

    Is the returned html rendered? It is better to get this html and insert it directly to the corresponding location.
    Html is returned.

    Jq can be easily used

    $(function() {  $('a').click(function(){    $('#test').load(this.href)    return false;  });});

    In this way, the original jump is changed to a partial refresh.
    Test is the id of the p you need to refresh locally.

    Of course, you will find that the entire page is displayed in p, so you need to modify the target program and let it return the required content.

    If you want to refresh it, use ajax and use asynchronous refresh.

    Use ajax .. Next page
    Script
    Function pageNext (Id)
    {
    ....
    Ajax. call ("page. php? Page = "+ Id, resPagedo, 'post', 'json ');
    }
    Function resPagedo (result)
    {
    Add data to p.
    }
    Script

    ... This process is probably the case.

    There is a requirement that only the data in the specified DIV in the page is refreshed during page turning, while the other p on the page does not move .... urgent, online ............ in addition, I flip pages like this

  • Homepage
  • Will refresh the whole page
    I remember that I could use iframe to do it. if you set an iframe for the refresh, the area will only be refreshed when paging !!! Try it.

    Ajax is preferred, but it can also be placed in iframe, but ajax is still needed.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.