帮我解决这个代码
var fileexists=0;
var name="sample.txt";
$.post("aaa.php?do=checkfileexists",{filename:name},function(data) {
    if ((data == "0000") || (data == "0000")) // file not exist .
    {
        fileexists=0;
    }
    if ((data == "1111") || (data == "1111")) // file exist .
    {
        fileexists=1; // file exits .
    }
});
alert(fileexists);
数据返回 1111 但文件存在于警报显示 0 为什么?!!!