tôi đang sử dụng javascript để nhận phản hồi xà phòng nhưng sau rất nhiều nỗi đau, tôi không thể nhận được yêu cầu http xml qua miền. vì vậy tôi quyết định chuyển sang jquery bây giờ tôi không cần mã số tôi chỉ cần một số mẹo và xác nhận nếu có thể trong jquery dưới đây là mã cho js của tôi var getmarket = new XMLHttpRequest(); getmarket.open ('POST', 'http://www.betfair.com/publicapi/', true);là có thể nhận yêu cầu SOAP miền chéo bằng cách sử dụng jquery
var m_request = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" '+
'xmlns:bfex="http://www.betfair.com/publicapi/v5/BFExchangeService/" '+
'xmlns:v5="http://www.betfair.com/publicapi/types/exchange/v5/">'+
' <soapenv:Header/>'+
'<soapenv:Body>'+
'<bfex:getAllMarkets>'+
'<bfex:request>'+
'<header>'+
'<clientStamp>0</clientStamp>'+
'<sessionToken>Y9eTuEvlrTM55pbRB1kIj0As0bVvz3eFm+p1FY+svHk=</sessionToken>'+
'</header>'+
'<locale>en</locale>'+
'<eventTypeIds>'+
'<v5:int>1</v5:int>'+
'</eventTypeIds>'+
'<countries>'+
'<v5:Country>GBR</v5:Country>'+
'</countries>'+
'<fromDate>2012-08-23TO00:00:00.000Z</fromDate>'+
'<toDate>2012-08-24TO00:00:00.000Z</toDate>'+
'</bfex:request>'+
'</bfex:getAllMarkets>'+
'</soapenv:Body>'+
'</soapenv:Envelope>';
getmarket.onreadystatechange = function(){
if (getmarket.readyState == 4 && getmarket.status == 200)
document.write(getmarket.responseText);
}
getmarket.setRequestHeader('Content-Type', 'text/xml');
getmarket.send(m_request);
document.write(getmarket.responseText);
URL đẹp, đặc biệt là URL thứ hai (toàn bộ trang web). Cảm ơn bạn, sẽ không bao giờ tìm thấy con đường của tôi ở đó nếu không! –