Ajax implements data deletion and view details functions

韦小宝
Release: 2018-01-01 18:26:06
Original
2015 people have browsed it

This article mainly introduces the functions of data deletion and viewing details through ajax, which is a good reference and value for learning ajax. Let’s follow the editor and take a look at this article about how ajax implements data deletion and view details functions.

Use bootstrap, jquery and ajax to display some data, add deletion functions and click to pop up the modal box details. Function

Main page main.php

    无标题文档  //引入bootstrap的css文件  //先引入jquery的js文件  //再引入其它的js文件  
  

显示数据

//用js向其中添加内容
代号 名称 操作

Copy after login

Load data page jiazai.php

Query($sql); // 下面实现的字符串是类似这样的n001^汉族|n002^回族|n003^苗族 $str = "";返回主页面的数据是TEXT型,得转换一下 foreach($arr as $v) { $str = $str.implode("^",$v)."|"; //拼接字符串 } $str = substr($str,0,strlen($str)-1); //去掉末尾的|字符。 echo $str;
Copy after login

Delete processing page shanchu.php

Query($sql,0)) { echo "OK"; } else { echo "NO"; }
Copy after login

View details page xiangqing.php

StrQuery($sql);
Copy after login

The above is all the content of this article, I hope it will be helpful to everyone’s learning! !

Related recommendations:

In-depth understanding of the XHR object in the first article of the ajax series

JSON data storage format for Ajax interaction with users

About multiple ajax request issues

The above is the detailed content of Ajax implements data deletion and view details functions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!