前端之家收集整理的这篇文章主要介绍了
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