Sindbad~EG File Manager

Current Path : /home/beeson/public_html/WebMathXpert/Demos/ProblemLibraryDemo/
Upload File :
Current File : //home/beeson/public_html/WebMathXpert/Demos/ProblemLibraryDemo/AjaxExample.html

<!DOCTYPE html>
<html>
<head>
    <title>Window Size Example</title>
</head>
<body>

<script>
// Function to send window dimensions to the server
function sendWindowSize() {
    var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
    
    // Create an AJAX request
    var xhr = new XMLHttpRequest();
    xhr.open("POST", "your_php_script.php", true);
    xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    
    // Send the dimensions as POST data
    xhr.send("width=" + width + "&height=" + height);
    
    // Optional: Handle the server response
    xhr.onload = function() {
        if (xhr.status == 200) {
            console.log("Dimensions sent successfully");
            console.log(xhr.responseText); // Server response
        } else {
            console.log("Error sending dimensions");
        }
    };
}

// Send dimensions after the page loads
window.onload = function() {
    sendWindowSize();
};
</script>

</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists