Cocos Creator 调用php接口,c#,java思路相同

var url="jk.php";
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
    if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
        var response = xhr.responseText;
        console.log("server response:"+response);
    }
};
xhr.open("GET", url, true);
xhr.send();

其实就是原生的js方法。

要想办法引入jq大笑





猜你喜欢

转载自blog.csdn.net/moniteryao/article/details/79810882