I am trying to update a users field by using jQuery.
My code is…
jQuery(document).ready(function(){
setInterval("imStillAlive()", 6000);
function imStillAlive() {
jQuery.post('/users/update_useractive',
function(data){
alert("updated");
});//post
}
});
The above code when ran shows the error…
“imStillAlive” not defined
How to resolve this?
Try this solution, as mention by Alex, it not necessary to write it inside document.ready as you are not doing any DOM manipulation.