Edit in JSFiddle

$("#divInitial").text("Initial Window width: " + $(window).width() + ", height: " + $(window).height() + ".");

//Event to handle resizing
$(window).resize(function () {
    var width = $(window).width();
    var height = $(window).height();
    //alert("width:"+ width + " and height:"+ height);
    $("#divResize").text("Window width: " + width + ", height: " + height + ".");
});
<div id="divInitial"></div>
<div id="divResize"></div>