Is there a way to accurately determine the viewport width of an iPad and iPhone using jQuery? My webpage is larger than the native size of these devices, causing it to be scaled down. I want to set the width of my content div to match each browser's width while keeping the scaling intact. This approach works well in desktop browsers, but when testing on iPads or iPhones, the iOS scaling presents challenges. I have tried using both 'width' and 'outerWidth()' methods without success.
$(window).resize(function() {
$('#content').css({width: $(this).outerWidth()});
});