Files
MoonPro.net/MP-TAB/Scripts/BrowserWindowSize.js
Samuele E. Locatelli 0d4435a0bb Rinominato progetto TAB
2018-05-03 14:55:02 +02:00

31 lines
697 B
JavaScript

// Browser windows size collector
window.onresize = function (event) {
SetWidthHeight();
}
function SetWidthHeight() {
var height = $(window).outerHeight();
var width = $(window).outerWidth();
$.ajax({
url: "./windowSize.ashx",
data: {
'Height': height,
'Width': width,
'PixRat': devicePixelRatio,
'scrWidth': screen.width,
'scrHeight': screen.height
},
contentType: "application/json; charset=utf-8",
dataType: "json"
}).done(function (data) {
if (data.isFirst) {
window.location.reload();
};
}).fail(function (xhr) {
//alert("Problem to retrieve browser size.");
});
}
$(function () {
SetWidthHeight();
});