Acubi
Acubi

Reputation: 2783

popUpWindow doesn't popup in the iframe

--mainPage.php----

<div>
    <iframe>pageA.php</iframe>
</div>
<div>
    <iframe>pageB.php</iframe>

</div>

The main page includes the two iframes which link to the pageA.php and pageB.php seperatly.

On PageA.php, there is a link to click displaying the popUpWindow.php. (See popUpwindow example: http://www.javascript-coder.com/files/window-popup/javascript-window-open-example1.html).

In my case, the popUpWindow.php doesn't popUp and pageA.php is replaced with popUpWindow.php after clicking the link. Following is my code, can anyone help me? Thanks in advance!

--pageA.php-----

<script type="text/javascript">
        // Popup window code
        function newPopup(url) {
                popupWindow = window.open(
                        url,'popUpWindow','height=700,width=700,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
        }
</script>

<a href="popUpWindow.php">Link</a>

Upvotes: 0

Views: 2210

Answers (1)

Johann
Johann

Reputation: 12408

Your A tag is wrong and should call your JavaScript function:

<a href="javascript:newPopup('popUpWindow.php');">Link</a>

Upvotes: 1

Related Questions