ajax返回的值怎么打印到不同的DIV里面
如何让“成功”打印到id=yes,“失败”打印到id=no呢<divid="yes"></div><divid="no"></div><script>functionue...
如何让“成功”打印到id=yes,“失败”打印到id=no呢
<div id="yes"></div>
<div id="no"></div>
<script>
function uess(){
$.ajax({
type:"POST",
url:"ajax.php",
data:{kk:"jb"},
success: function(data) {
$("#yes").html(data);
}
});
return false;
};
</script>
<?php
if($kk=="jb"){
echo "成功";
exit();
} else {
echo "失败";
exit();
}
?> 展开
<div id="yes"></div>
<div id="no"></div>
<script>
function uess(){
$.ajax({
type:"POST",
url:"ajax.php",
data:{kk:"jb"},
success: function(data) {
$("#yes").html(data);
}
});
return false;
};
</script>
<?php
if($kk=="jb"){
echo "成功";
exit();
} else {
echo "失败";
exit();
}
?> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询