I want to POST the screen width of the device the user is using (client side) to a PHP page which in return would use an if block to say if less than 768px use this layout else another. Even though I’m very ne to jQuery AJAX I’ve been able to put together the following using tutorials on YOUTUBE and others but have come to a dead-end. for the data.
[code]
$(document).ready(function() {
if (window.orientation == 0) {
var width;
$(window).bind(‘orientationchange’, function() {
if ($(window).width() < 768) {
width = $(window).width();
$.post(‘test1406.php’,
{ : width}, <–
function() {
});
} else {
width = $(window).width();
}
});
if ($(window).width() < 768) {
width = $(window).width();
} else {
width = $(window).width();
}
}
});
I’ve marked exactly where I’m stuck. Since its not a form value, I don’t exactly have a say for example a textbox name.
I could wrong
Any Ideas, Solutions/ Answers, pointers/tips would be very much appreciated