摘要
本文讨论在.NET平台下,前台页面通过jQuery和Ajax技术访问后台数据库中的数据,采用JSON作为Ajax中数据的传输格式,从而实现页面间无刷新的数据访问效果。前台页面通过Ajax向后台发出异步的Post请求(或get请求),.NET平台收到发过来的请求后进行解析处理,从后台数据库中获取所需要的数据,之后封装成JSON格式的数据,并将数据返回给请求页面,请求页面利用jQuery解析返回来的JSON格式的数据,最后呈现给用户。文中采用jQuery+Ajax+JSON模式,在动态页面间实现数据的传输,前台页面无需刷新,既提高了用户的体验感,又减少了数据的传输量,同时减轻了网络的负担。
In this paper, on the platform of.NET, the front page get access to the background data in the database through the jQuery and Ajax technology, using JSON as the transmission format of the data in the Ajax, so as to achieve the effect of data access without page refresh. The front page sends asynchronous Post requests(or get request) to the background via Ajax,.NET platform receives the request and processes it, and obtains the required data from the database; then, it encapsulates the data into JSON format, and returns the data to the page request. The requested page usie the jQuery parsing JSON format to return the data finally presented to the user. JQuery+Ajax+JSON model is used in this paper to achieve data transmission in a dynamic page, and front page without refresh, which not only improves the user experience, but also reduces the amount of data transmission and the burden of network.
出处
《科技广场》
2017年第4期77-80,共4页
Science Mosaic