Try this, Always use Url.Action
instead of hard code URL
<script type="text/javascript">
var check;
function checkForMessages() {
$.get('@Url.Action("ActionName","ControllerName")',
function ( data ) {
//what should I check here from controller?
if ( ) {
//There are new messages
clearInterval( check );
alert("You have mail!");
}
}
}
check = setInterval( checkForMessages, 60000 );
</script>