如何在弹出窗口中频繁显示ajax响应

时间:2013-12-07 06:02:52

标签: php ajax

    $.ajax({
            type : "POST",
            url:"<?php echo TESTMINE_APP_URL; ?>/ajax/export-details",
            data:'paginationHash='+paginationHash+'&exportType='+exportType+'&userId='+userId,
            dataType: "html",
            success: function(requestId) 
            {
                setInterval(function () {
                var status = checkStatusOfRequest(requestId);
                //here status has to show in pop up window
                }, 9000);

            }
       });

1 个答案:

答案 0 :(得分:0)

如果您只想将结果写入弹出窗口,可以使用:

success: function(requestId){
  var popup = window.open("");
  popup.document.write('<html><body>Status: <span id="status"></span></body></html>');

  setInterval(function(){
     var status = checkStatusOfRequest(requestId);
     popup.document.getElementById('status').innerHTML = status;
  }, 9000)
}