我正在集成一个 PHP 代码来将站点地图 ping 到谷歌和 Bing。代码执行完美,但如果我从 ajax 调用发起请求,那将是事实。它不会返回下面是我用来进行 ajax 调用的 Jquery 代码$("body").on('click', 'button#sitemap_google_submit', function(event){ toastr.info("Would require few seconds, Please wait, do not refresh Page..", "Submitting Sitemap to Google!", { progressBar:!0, showMethod:"slideDown", hideMethod:"slideUp", timeOut:2e3, preventDuplicates: true, positionClass: "toast-bottom-right" } ); $("button#sitemap_google_submit").attr("disabled", true); $("button#sitemap_google_submit").html("<i class='ft-loader spinner'></i> Submitting to Google.."); $.ajax({ url: '/bypasser/modules/seoController.php', type: 'POST', dataType: 'JSON', data: {type: 'submit', console: 'google'}, }) .done(function(resp) { $("button#sitemap_google_submit").attr("disabled", false); $("button#sitemap_google_submit").html("<i class='fa fa-google fa-lg'></i> Submit to Google"); toastr[resp.type](resp.message, resp.heading, { showMethod:"slideDown", hideMethod:"slideUp", preventDuplicates: true, positionClass: "toast-bottom-right" }); }); });JSON 编码在检查元素的网络选项卡的预览面板中完美显示,但不知何故它不返回对 ajax 的响应,这是什么问题?
1 回答
SMILET
TA贡献1796条经验 获得超4个赞
放
curl_setopt($ch, CURLOPT_HEADER , false); // we don't want headers
代替
curl_setopt($ch, CURLOPT_HEADER , true); // we want headers
我们也不需要标头,据我了解您的问题,您可能只是在寻找 ping 状态代码!
- 1 回答
- 0 关注
- 86 浏览
添加回答
举报
0/150
提交
取消