我有 send.php:
<?
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'http://www.example.com');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
}
?>
并且有receive.html:
function makeRequestXML(url) {
http_request = false;
...
http_request.onreadystatechange = ContentsXML;
http_request.open('GET', 'send.php', true);
http_request.send(null);
}
function ContentsXML() {
alert(http_request.readyState);
alert(http_request.status);
if (http_request.readyState == 4) {
if (http_request.status == 200) {
number_checkbox = 0;
var xmldoc = http_request.responseXML;
但 xmldoc 不是 XML。我想发送 XML($out)。我该怎么做?