What are the limitations of using document.write() in PHP for adjusting layer widths dynamically?

When using document.write() in PHP to adjust layer widths dynamically, one limitation is that it can only be used to write content to the document once it has finished loading. This means that if you try to use document.write() to adjust layer widths dynamically before the document has finished loading, it may not work as expected. To solve this issue, you can use JavaScript to adjust layer widths dynamically instead of using document.write().

<?php
echo '<script>
    window.onload = function() {
        document.getElementById("yourLayerId").style.width = "100px";
    };
</script>';
?>