Ajax does not jump to the page to quickly delete operations, you can add beautiful styles, ajax jump

Source: Internet
Author: User

Ajax does not jump to the page to quickly delete operations, you can add beautiful styles, ajax jump

In the past, we talked about how to use embedded php code to jump to another page, which reduces the deletion speed. However, the usage of ajax today not only can quickly delete non-Skip pages, you can also add special effects to beautify the page.

 

 

On the code, let's take the lead page first

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

Loading pages referenced by ajax on the home page

<?phpinclude("../LZY.class.php");$db = new LZY();$sql = "select * from nation";$arr = $db->Query($sql);$str = "";foreach($arr as $v){$str = $str.implode("^",$v)."|";}$str = substr($str,0,strlen($str)-1);echo $str;

Results:

Next, we will delete the processing page.

<?phpinclude("../LZY.class.php");$db = new LZY();$code = $_POST["code"];$sql = "delete from nation where code='{$code}'";if($db->Query($sql,0)){echo "OK";}else{echo "NO";}

  

Using ajax for deletion is so simple ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.