ajax timer function

ajax timer function

Hi

Time for another challenge. I want to implement a timer that calls a jquery funtion every 30 seconds.

I have found this example on the internet:
setInterval(function() { alert('Next alert in 30 secs'); }, 5000); //5 seconds

How is it included in a my html / Jquery script ?

Something like this?

$(document).ready(function () {
     setInterval
(function() {
         alert('Next alert in 30 secs')
; }, 5000); //5 seconds

});