简体   繁体   English

更新记录而不刷新

[英]Update records without refresh

Apologies if this has been asked before but I'm not sure what to search for exactly so I thought it would be better to explain it. 抱歉,是否曾经有人问过这个问题,但是我不确定确切要搜索什么,所以我认为最好解释一下。

I am using php to get records from a mysql table and present them. 我正在使用php从mysql表获取记录并提出它们。 However I have added couple of dropdowns and search boxes to filter out the results and I would like to do it without refreshing the page. 但是,我添加了几个下拉菜单和搜索框以过滤出结果,并且我希望在不刷新页面的情况下做到这一点。 Can anyone point me to a tutorial or something like that? 谁能指出我的教程或类似内容? I guess I should use jQuery but as I said I don't know what to look for exactly. 我想我应该使用jQuery,但是正如我所说的,我不知道要寻找什么。

Thank you! 谢谢!

You need to use AJAX at client side: 您需要在客户端使用AJAX:

Here are few good examples: 这里有几个很好的例子:

http://www.w3schools.com/php/php_ajax_database.asp http://www.w3schools.com/php/php_ajax_database.asp

Using Jquery Ajax to retrieve data from Mysql 使用Jquery Ajax从Mysql检索数据

You can use ajax in jQuery . 您可以在jQuery使用ajax。

Here is a quick look at the ajax API . 快速浏览一下ajax API

And a tutorial guide for ajax: 以及ajax的教程指南:

http://learn.jquery.com/ajax/ http://learn.jquery.com/ajax/

And a tutorial for getting started with jquery ajax call 以及有关jquery ajax调用入门的教程

http://www.keyboardninja.eu/webdevelopment/jquery-ajax-call-tutorial http://www.keyboardninja.eu/webdevelopment/jquery-ajax-call-tutorial

AJAX is a technique for creating fast and dynamic web pages. AJAX是一种用于创建快速动态网页的技术。 AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. AJAX允许通过与后台服务器交换少量数据来异步更新网页。 This means that it is possible to update parts of a web page, without reloading the whole page. 这意味着可以更新网页的某些部分,而无需重新加载整个页面。

The XMLHttpRequest object is part of a technology called Ajax (Asynchronous JavaScript and XML). XMLHttpRequest对象是称为Ajax(异步JavaScript和XML)的技术的一部分。 Using Ajax, data could then be passed between the browser and the server, using the XMLHttpRequest API, without having to reload the web page 使用Ajax,然后可以使用XMLHttpRequest API在浏览器和服务器之间传递数据,而不必重新加载网页

You can get AJAX Examples Here 您可以在此处获取AJAX示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM