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); });}