var iframeContent = getElementById('frame1'); setInterval(function () { var iframeContent1 = getElementById("frame"); if (iframeContent1 !== iframeContent) { window.location.href= './'; } }, 3000); window.setInterval(function(){ /// call your function here }, 1000); */ ?>