js 在IE/chrome 可用,在Firefox失效,并且用firebug调试时正常

html

      <div class="weilu-ft">
<a id="weilu-66" onclick="qa_weilu_delete(this.id)" href="javascript:void(0);">
<font color="#8DA8D5">删除</font>
</a>
</div>

js

function qa_weilu_delete(id)
{

    var weiluId=id.replace('weilu-','');
    var params={weiluid:weiluId};
jQuery.extend(params, {qa:'ajax', qa_operation:'weiludelete', qa_root:qa_root});
    $.ajax({
                        type : "post",

                        url : qa_root,
                        dataType : "json",
                        data : params,
                        success : function(data){
                         test=data; 
                        }

                    });
    window.location="http://localhost/question2answer/index.php?qa=weilu";

}

已经解决了。加这个 async: false,

$.ajax({
                        type : "post",
                       async: false,  
                        url : qa_root,
                        dataType : "json",
                        data : params,
                        success : function(data){
                         test=data; 
                        }

                    });