Home >Backend Development >PHP Tutorial >PHP realizes that the input box loses focus and automatically saves the data of the input box_PHP tutorial

PHP realizes that the input box loses focus and automatically saves the data of the input box_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:49:261529browse

Auto-save is often used in editors. To achieve scheduled data saving, we will use the ajax function. Let’s look at an example of an input box losing focus and automatically saving data in the input box.

I recently made an input box. The function of automatically saving data when losing focus is of course the jQuery selector selecting input and blur. Ajax submits the data to the php file, and the php file saves the data. The main thing is to pay attention to the Chinese problem, so the encoding needs to be changed in the middle.

The example below is a list page, a bit similar to excel.

html code:

The code is as follows Copy code
 代码如下 复制代码








{$id} 预览编辑





{$id}