更新文本文件时,不在网页中更新

时间:2013-12-06 09:27:09

标签: jquery

尝试使用jquery

在html页面中读取本地文本文件
<!DOCTYPE html>
<html>

  <head>

       <script charset="utf-8" src = "jquery-2.0.3.min.js"></script>

<script>
function read()
{
    $.get("version.txt", function(data) {
     document.write(data);
});

setTimeout(read, 2000);

}
</script>

<body onload="read()">

How r u
</body>
</html>

它正常工作,但是当文本文件更新时,更改不会反映在页面中。有人可以帮我这个吗?

0 个答案:

没有答案
相关问题