I\'m using Asp.net MVC and I want my partial view to refresh on an interval, which it does until I make an unrelated Ajax request, then it stops.
Here are a few simp
If your AjaxRefresh.js has just the code you showed us, you can use this code. When the browser call the .js it will start functioning.
var ajax = {
init: function() {
ajaxRefresh();
setTimeout(init, 1000);
}
ajaxRefresh: function()
{
var f = $("#AjaxForm");
$("#AjaxLoading").show();
$.post(f.attr("action"), f.serialize(), function (context) {
$("#AjaxDiv").html(context);
$("#AjaxLoading").hide();
});
}
}
ajax.init();