GF Frame Paging Module (iv)-AJAX paging

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Article Source: http://gf.johng.cn/597434

The difference between Ajax paging and other paging methods is that the paging link is implemented using the JavaScript method, which is a paging method that is fixed to the paging URL address for that page.

The complete example is as follows:

Package Mainimport ("Gitee.com/johng/gf/g/os/gview" "Gitee.com/johng/gf/g/net/ghttp" "gitee.com/johng/gf/g/util/ Gpage ") Func main () {s: = Ghttp. Getserver () S.bindhandler ("/page/ajax", func (R *ghttp). Request) {page: = Gpage. New (+, R.get ("page"), R.url. String (), R.router.uri) page. Enableajax ("Doajax") buffer, _: = Gview. Parsecontent (' 

In this example, we define a DoAjax(url) method to perform the paging operation, which is simple for the demo, which loads the contents of the specified paging page and overwrites the paging content of the current page.

function DoAjax(url) {     $.get(url, function(data,status) {         $("body").html(data);     });}
Related Article

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.