\n'); } function getCountryData(countryName) { var s = 'S1=' + countryName + '&lang=' + escape(LINGUA); XHR._sdff = 'e'; if (!XHR.send('POST', '/ajxFeedCorGlobPresenca.php', s, 10000, 'rnd', false, countryData, onAjxCountryResponse)) { xInnerHtml(countryData.id, '
Request Error.
Please try again<\/p>');
} else {
if (LINGUA == 'EN') xInnerHtml(countryData.id, 'loading data ...');
else xInnerHtml(countryData.id, 'a carregar dados ...');
}
return false;
}
function onAjxResponse(req, status, obj) {
if (status == XHR.OK) {
if (obj.xml) s = xParseXml(req.responseXML, obj);
else s = req.responseText;
}
else {
if (status & XHR.TIMEOUT) { s = '
Timeout Error<\/p>'; } if (status & XHR.NOXMLCT) { s = '
XML content-type expected but received: ' + req.getResponseHeader('Content-Type') + '<\/p>'; } if (status & XHR.RSPERR) { s = '
Response Error (' + req.status + '): ' + req.statusText + '<\/p>'; } } xInnerHtml(obj.id, s); } function onAjxCountryResponse(req, status, obj) { onAjxResponse(req, status, obj); } function ajxData(id, xml, xe, ot, ct){ this.id = id; // element to receive response this.xml = xml; // true if expecting xml response // parse data this.xe = xe; // xml element to find, whose content is to be enclosed in the following this.ot = ot; // opening tag this.ct = ct; // closing tag }
|
|||||||||||||||||||
|
|||||||||||||||||||