当jquery运行时,这不是“成功”,这是在“错误”部分。我的php文件在另一个server.code就像下面。
$(document).ready(function() {
//if submit button is clicked
$('#recaptcha_reload').click(function () {
var data ="publick="+document.getElementById("publickeyval").value+"&privatek="+document.getElementById("privatekeyval").value;
alert(data);
//start the ajax
$.ajax({
//this is the php file that processes the data and send mail
url: "http://www.example.com/example_api/example_adcpatchaapi.php",
//GET method is used
type: "GET",
//pass the data
data: data,
//Do not cache the page
cache: false,
//success
success: function (html) {
alert(html);
if (html) {
document.getElementById('captcha_table').innerHTML=html;
} else{
alert("####"); // runing this alert box
}
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status); // showing 0
}
});
//cancel the submit button default behaviours
return false;
});
});