0
的index.html
<!DOCTYPE html>
<html>
<head>
<title>Récupération d'un contenu HTML en Jquery Ajax</title>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<script type="text/javascript">
function recupTexte() {
$.ajax({
url: "data.xml"
})
.done(function(texte) {
$('body').append(" : " + texte);
});
}
setInterval(recupTexte, 1000);
</script>
</body>
</html>
data.xml中
test
当我去我的网页浏览器Safari浏览器,我有 “测试” 显示,但是当我手动编辑我的data.xml文件以“更改”,Safari继续显示“测试”并且没有“更改”。为什么?我不明白... ...
所以,就这么说吧,这段代码只适用于safari和local。当我把它放在服务器上时,什么都不显示....
里面没有,这是行不通的。没有显示... –