I have done this and its works fine but its not really efficient picking up the screen width when the orientation of the device has changed (IT DOES) but is a bit slow but works perfect
[code]
$(document).ready(function() {
var width;
width = $(window).width();
var screenWidth = width;
$.ajax({
method: “POST”,
url: “menu.php”,
data: {
screenWidth : width
},
success: function (res) {
$(‘body’).html(res);
}
});
});
I’m aware of orientationchange function but not quite sure how to piece it together with say for example device that don’t have an orientation change such as desktop/ laptop devices
Does anyone have a better/ more efficient way of doing this (posting the client’s screen width to a server side PHP script) including for orientation change.