function getProject(){
var postData = {
'project' : proj_id
};
//console.log(postData);
var site_url = "<?php echo site_url('/'); ?>";
$.ajax({
type: "POST",
url: site_url + "maincontroller/project",
data: postData, //assign the var here
success: function(msg) {
$("#project").html(msg);
getSubProject();
}
});
假设这是一个函数,现在我想对 AJAX 响应应用条件,响应 id 为<div id="project"></div>
. 如果响应成功,则生成此 div,否则不生成。任何人都可以帮助我吗?