Sha256: 12b07b3327da9105623dc12f7ef9b4fbe6b84dc8e18cca63709545494127abba
Contents?: true
Size: 601 Bytes
Versions: 15
Compression:
Stored size: 601 Bytes
Contents
jQuery -> poll_interval = 2 poll_start = (el) -> href = el.attr("href") el.parent().text "Starting..." $("#main").addClass "polling" setInterval (-> $.ajax dataType: "text" type: "get" url: href success: (data) -> $("#main").html data $("#main .time").relativeDate() ), poll_interval * 1000 location.hash = "#poll" # auto start if hash is poll poll_start $("a[rel=poll]") if location.hash == "#poll" # start when click on link $("a[rel=poll]").click (e) -> e.preventDefault() poll_start $(this)
Version data entries
15 entries across 15 versions & 5 rubygems