<script type="text/javascript">
var requestTimes = 0;
function sendrequest(orderId) {
var image = document.createElement("IMG");
image.src = "http://cps.lovo.cn/order/pushOrder.do?orderId=" + orderId;
image.width = 0;
image.height = 0;
image.onerror = retryrequest(orderId);
image.onload = clean();
document.body.appendChild(image);
return true;
}
function retryrequest(orderId) {
if (this.requestTimes < 3) {
this.requestTimes++;
sendUnionClick(orderId);
} else {
this.requestTimes = 0;
}
}
function clean() {
this.requestTimes = 0;
}
</script>
转载于:https://www.cnblogs.com/doosmile/archive/2011/12/28/2304797.html