我有一个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