客户端页面往服务器传数据的简单方法
var url = '/status_tracker.php';var params = ['step=2', 'time=1248027314'];var beacon = new Image();beacon.src = url + '?' + params.join('&');beacon.onload = function() {if (this.width == 1) {// Success.} else if (this.width == 2) {// Failure; create another beacon and try again.}};beacon.onerror = function() {// Error; wait a bit, then create another beacon and try again.}原文出自:《High.Performance.JavaScript》
页:
[1]