Component.onCompleted: {
var x = new XMLHttpRequest();
x.onreadystatechange =function()
{
if(x.readyState == 4) {
if(x.status == 200) {
console.log("服务器返回值: " + x.responseText);
}
}
};
x.open("GET","http://localhost/index3.php?test=5");
x.send(null);
}
<?php
$xml = $_GET["test"];
echo $xml;
?>