try this
<script>
var interval = 5;
interval = interval * 1000;
var obj = {};
window.setInterval(poll, interval);
function poll() {
$.ajax({
url: "/ControllerName/YourActionName",
type: "POST",
data: obj,
dataType: "json",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function (data) {
},
error: function () {
alert("An error has occured!!!");
}
});
}
</script>
[HttpPost]
public ActionResult YourActionName() {
object data ;
return Json(data);
}
refer
jQuery.ajax() | jQuery API Documentation[
^]
Window setInterval() Method[
^]