javascript中使用ajax演示
[ 2011-04-12 14:44:09 | 作者: admin ]
统计打印次数
<a href="#rh" onClick="javascript:{ doprint();}"><font color="#ff3333">点击打印优惠券</font></a>
<script language="javascript" type="text/javascript">
var request = false;
try {
request = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = false;
}
}
}
if (!request)
alert("Error initializing XMLHttpRequest!");
function getCustomerInfo() {
//var phone = document.getElementById("phone").value; //escape(phone)
var url = "count.asp";
request.open("GET", url, true);
//request.onreadystatechange = updatePage;
request.send(null);
}
function updatePage() {
alert("Server is done!");
}
function doprint(){
getCustomerInfo();
print();
}
</script>
<a href="#rh" onClick="javascript:{ doprint();}"><font color="#ff3333">点击打印优惠券</font></a>
<script language="javascript" type="text/javascript">
var request = false;
try {
request = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = false;
}
}
}
if (!request)
alert("Error initializing XMLHttpRequest!");
function getCustomerInfo() {
//var phone = document.getElementById("phone").value; //escape(phone)
var url = "count.asp";
request.open("GET", url, true);
//request.onreadystatechange = updatePage;
request.send(null);
}
function updatePage() {
alert("Server is done!");
}
function doprint(){
getCustomerInfo();
print();
}
</script>
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1664
这篇日志没有评论。
此日志不可发表评论。