2 qingshanli1988 qingshanli1988 于 2014.08.22 16:50 提问

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";

}

1个回答

qingshanli1988
qingshanli1988   2014.08.22 17:05

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

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

                    });
Csdn user default icon
上传中...
上传图片
插入图片