Jquery-how to implement the modification function using ajax, that is, reading data from edit. php and updating. php. How can this problem be achieved?

Source: Internet
Author: User
How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data? How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data?

Reply content:

How can we use ajax to implement the modification function? How can we use edit. php to read data and update. php to update data?

If ajax is submitted to edit. php and edit. php, useheader("Location:update.php");..

In fact, I think you want to use ajax to complete the process. After an edit file is submitted, edit receives the form and saves it successfully. The saved information is returned in json format, the browser receives and completes some dom operations.

Like

$.ajax({  type:'post',  url:'edit.php',  success:function(data){    $(result).html(JSON.parse(data));  }})
// Excerpt from the page I wrote at the beginning of last year.
  Query ($ query) === TRUE) {if ($ pids = $ mysqli-> query ($ queryId) {while ($ id = $ pids-> fetch_object ()) {$ pid = $ id-> id; }}$ result = array ('id' => $ pid, 'type' => $ type, 'uid' => $ uid, 'content' => $ content, 'create _ time' => date ("H: I: s Y-m-d ", strtotime ($ create_time), 'editable' => true); echo json_encode ($ result);} else exit ();

Master station. Can I find details?

$('submit_btn').click(function(){    $.post('http://www.example.com/update.php',{data:data},function(callback){})})

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.