req.open((body!=null)?'POST':'GET', '/cgi-bin/cwebfiles/'+script+(qs?'?'+qs:''), !!cb)
if (cb) {
req.onloadend = function() {
- cb(req.status, req.responseText)
+ var status = req.getResponseHeader("Status") || req.status.toString(10)
+ status = status.split(' ')[0]
+ status = parseInt(status, 10)
+ cb(status, req.responseText)
}
}
req.send(body)
if (!cb) {
- return {status: req.status, data: req.responseText}
+ var status = req.getResponseHeader("Status") || req.status.toString(10)
+ status = status.split(' ')[0]
+ status = parseInt(status, 10)
+ return {status: status, data: req.responseText}
}
}