我有一個Ajax/PHP代碼,我想檢查返回的文本是真還是假:檢查返回的文本是真的還是假
$(".gets").click(function() {
// some details
$.ajax({
type: "POST",
url: "step2.php",
data: dataString,
success: function(data) {
// This is the button to hide
$('.nums').fadeOut('fast');
} // end function
}); // end ajax
return false;
});
step2.php
if($num < 3) {
echo 'please choose at least 3 nums<br />';
$hideButton = false; // hide show nums button
} else {
$hideButton = true;
}
在此先感謝
但警報(數據);返回第2步的完整代碼 – 2014-08-28 17:25:36
然後它聽起來像PHP沒有運行。你在網絡服務器上做了這個嗎?還是你在本地加載文件? – 2014-08-28 17:27:19
PHP沒有運行!!!!!怎麼來的???我沒有使用json,我使用的是PHP/Ajax,所以如果我打電話給step2.php,我會收到step2.php中的完整代碼(使用alert和console) – 2014-08-28 17:29:46