How can I use interval in js? For example I want to call a function every 5 seconds?
<script type="text/javascript">
setInterval(openAPage(), 5000);
function openAPage() {
var startTime = new Date().getTime();
var myWin = window.open("http://www.sabah.com.tr","_blank")
var endTime = new Date().getTime();
var timeTaken = endTime-startTime;
</script>
This script doesn't work, anyone know why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…