我的剧本用Chrome写的。我在边缘和IE10方面遇到了一些困难。我已经把范围缩小到下面的剧本了。经过一些测试后,它在边缘中工作,但仍然不能在IE10中工作。
JS库:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript">
JS
function scrollhandler() {
$.getJSON("check_time_scroll.php", function(update) {
if (update.count===true) {
alert("Update available");
}
});
}
setInterval(scrollhandler, 10000);附加信息:check_time_scroll.php检查数据库中是否有新的相关内容。如果存在,我将得到一个true,如果true,则将内容加载到<div>中。
出于测试目的,我已经用一个<div>替换了alert加载脚本。
我是不是用错了图书馆?在边缘中,警报测试可以工作,但不会使用原始脚本将内容上载到<div>。
原稿:
function scrollhandler() {
$.getJSON("check_time_scroll.php", function(update) {
if (update.count===true) {
$("#scrolltext").load('unifoscrolltext.php');
}
});
}
setInterval(scrollhandler, 10000);发布于 2016-07-01 23:59:31
也许IE10在缓存信息方面有问题。
function scrollhandler() {
var d = new Date();
var cache = d.getTime();
$.getJSON("check_time_scroll.php?cache=" + cache, function (update) {
if (update.count === true) {
$("#scrolltext").load('unifoscrolltext.php?cache=' + cache);
}
});
}
setInterval(scrollhandler, 10000);https://stackoverflow.com/questions/38155123
复制相似问题