用JavaScript实现:POST http103215362268007webmsphpc=common&a=blackWordsapplicationx-www-form-urlencodedblackWords 作为变量整合成一个函数
function postBlackWords(blackWords) { var xhr = new XMLHttpRequest(); var url = "http://103.215.36.226:8007/webms.php?c=common&a=blackWords"; var params = "blackWords=" + encodeURIComponent(blackWords); xhr.open("POST", url, true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } }; xhr.send(params); }
原文地址: http://www.cveoy.top/t/topic/iC17 著作权归作者所有。请勿转载和采集!