本文实例讲述了TP5(thinkPHP5)框架使用ajax实现与后台数据交互的方法。分享给大家供大家参考,具体如下:
方法一: serialize() 方法通过序列化表单值,创建 URL 编码文本字符串,这个是jquery提供的方法
前端代码
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<title>ajax交互</title>
[removed][removed]
[removed]
$('.but').click(f