için iFrame kaynağını ayarlamak her iFrame her zaman içinden bu şekilde döngü ne istediğiniz basitleştirilmiş olabilir gibidir:
$('#reload').click(function() {
$('#f1').attr('src', $('#f1').attr('src'));
return false;
});
Ya
$('#reload').click(function() {
$('#f1')[0].contentWindow.location.reload(true);
return false;
});
Ancak belki de onun cevapları ihtiyaçlarınız için daha uygundur.
UPDATE: Yukarıdaki yöntem kullanılarak birlikte çalışan bir örnek koymak
. Zaman basan başka bir sayfa gösteren bir sayfada var.
HTML (time.html):
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
The time is now <span id="time"></span>.
<script type="text/javascript">
$(document).ready(function() {
$('#time').html((new Date()).toString());
});
</script>
</body>
Ve üst sayfa HTML (test.html): Bu Firefox'ta benim için sadece iyi çalışır
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<iframe id="frame" src="file:///D:/Users/Cory/Desktop/time.html" width="500" height="250"></iframe>
<button id="reload">Refresh</button>
<script type="text/javascript">
$(document).ready(function() {
$('#reload').click(function() {
$('#frame').attr('src', $('#frame').attr('src'));
return false;
});
});
</script>
</body>
3.6 ve IE 7.
İşte kodum:
\tyükle sizin için –