What are some common pitfalls or browser-specific issues to be aware of when using window.open() in PHP for pop-up windows?

One common pitfall when using window.open() in PHP for pop-up windows is that some browsers may block the pop-up if it is not triggered by a user interaction, such as a click event. To solve this issue, you can ensure that the window.open() function is called within a user-triggered event handler.

<button onclick="openPopup()">Open Popup</button>

<script>
function openPopup() {
  window.open('popup.php', '_blank', 'width=500,height=500');
}
</script>