<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("button").click(function(){
//$.post("http://localhost/api/ajax.asp", //This is working
$.post("http://zequet.somee.com/ajax.asp", // This is not working
{
name: "100"
},
function(data,status){
console.log(data);
document.getElementById("change").innerHTML = data;
if (data.success) {
alert("STATUS: " + status);
}
else {
alert("STATUS: " + status);
}
});
});
});
Ticket: <span id="change"></span>
<button>Test</button>
这是ajax.asp代码
<%
Dim fname
fname = Request.Form("name")
fname = fname + 1
Response.Write(fname)
%>
使用$ .post(&#34; http://localhost/api/ajax.asp&#34; 但是当使用$ .post(&#34; http://zequet.somee.com/ajax.asp&#34;从我的本地计算机执行时,它不起作用。