Simple AJAX data modification, deletion, increase operation (1/3)

Source: Internet
Author: User

<title>ajax No refresh Add and delete data </title>
<style>
body{
font-size:12px;
}
table{
Border-collaps tutorial E:collapse;

}
</style>
<body>
To show more fluency, we read only the latest 10 data in the database tutorial. Because the number of online testing is much. are operating on a database. Concurrency may occur!
Input: <input id= "str" type= "input"/> <input type= "button" value= "OK Add" onclick= "Add_post ()"/>
<span id= "msg" style= "color:red" ></span>
<table border= "1" ><!--This table is used to display data content-->
<tbody id= "a" ></tbody>
</table>
<span style= "color:red" > Action tip: Click the data you want to delete with your mouse. Then click Delete Button! </span>
<input id= "hid_id" type= "hidden"/>
<input type= "button" value= "delete data" onclick= "Del_data ()"/>
<script type= "text/web Effects" >
function Ajax_xmlhttp () {
Create XMLHttpRequest in IE, suitable for all versions above ie5.0
var msxmlhttp = new Array ("msxml2.xmlhttp.5.0", "msxml2.xmlhttp.4.0", "msxml2.xmlhttp.3.0", "Msxml2.xmlhttp", " Microsoft.XMLHTTP ");
for (var i=0; i<msxmlhttp.length; i++) {
Try
{
_xmlhttp=new ActiveXObject (Msxmlhttp[i]);
}
catch (E)
{
_xmlhttp=null;
}
//loop to create XMLHTTP based on IE browser. end
If not IE browser, create a browser based on Firefox XMLHttpRequest
if (!_xmlhttp && typeof XMLHttpRequest!= "undefined")
{
_xmlhttp=new XMLHttpRequest ();
}
return _xmlhttp;
}

Home 1 2 3 last
Related Article

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.