日期:2014-05-16 浏览次数:20394 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>js test</title>
<script language="javascript" type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
<script>
function ajaxRes(){};
ajaxRes.flag = true;
function aj(){
$.ajax({
type: "POST",
url: "test.php",
async:'false',
data: "",
success: function(msg){
ajaxRes.flag = msg;
alert(ajaxRes.flag);
}
});
//alert(ajaxRes.flag);
if(ajaxRes.flag=='m0'){
alert('000');
}else{
alert('111');
}
}
aj();
</script>
</body>
</html>