当进程id完成时,jQuery加载结果

时间:2014-04-21 06:13:27

标签: javascript jquery perl jquery-load

表单提交后,我将pID存储在文件中。 我通过Perl的Proc :: Daemon模块保存它。

my $daemon = Proc::Daemon->new(
    work_dir     => "directory",
    child_STDOUT => 'output.file',
    child_STDERR => '+>>debug.txt',
    pid_file     => 'pid.txt',
    exec_command => "my_command",
    );

我想知道是否有一个简单的方法来检查jQuery,如果进程已经完成,如果是,重新加载/刷新或加载到div?

到目前为止,我有一些非常简单的东西,当点击按钮时,会将我的文件内容加载到元素中。

<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.11.0.min.js">
</script>

<script>
  $(document).ready(function(){
  $("button").click(function(){
  $("#div1").load("output.file#p1");
  });
});
</script>

</head>

<body>
<div id="div1"><p id="p1"></p></div>
<button>Get External Content</button>
</body>
</html>`

将立即与pid.txt一起创建output.file。 output.file在开头是空的,并且在pID完成之前会填充数据。

现在,更多关于这个故事:如果pID没有完成,我希望有一条临时信息说'请等待'。

感谢您的任何建议或建议。

0 个答案:

没有答案