我正在集成一個 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 關注
- 141 瀏覽
添加回答
舉報
0/150
提交
取消