Home  >  Article  >  Backend Development  >  Code example to simply implement asynchronous page refresh through php+JQuery+Ajax

Code example to simply implement asynchronous page refresh through php+JQuery+Ajax

jacklove
jackloveOriginal
2018-06-15 14:34:311399browse

The page is displayed as follows:

The code in JQueryAjax.html is as follows (using the simpler $.post)





JQueryAjax+PHP


用户名:
密码:

ajax.php:

ajax.php
";
//这里可以进行一些操作,比如数据库交互


echo "操作完毕";
?>

In non-json format, the background can only return strings. If you want to return an array in the background, you can use json format

For example, in JQueryAjax The code is modified to the following form:




JQueryAjax+PHP


用户名:
密码:

ajax.php

The running effect is as follows:


##This article explains how to use php JQuery Ajax simply implements a code example of asynchronous page refresh. For more related content, please pay attention to the PHP Chinese website.

Related recommendations:

thinkphp redis queue related issues

Build a lamp on the server (Linux (CentOS7) Apache MySQL PHP)

Explanation of simple examples of Android PHP MYSQL development

The above is the detailed content of Code example to simply implement asynchronous page refresh through php+JQuery+Ajax. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn