Results 1 to 2 of 2

Thread: Can a jsp file in an IFrame calls a javascript function outside of the IFrame

  1. #1
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can a jsp file in an IFrame calls a javascript function outside of the IFrame

    Hi:

    I am using IE 6 SP2.
    My resize attribute does not work <body onresize="test1();">.
    When I resize my window, the resize event doesnot get call.

    I have a jsp page with an iFrame called test1.jsp. The iFrame src points to a page called test2.jsp. It has a resize
    attribute that calls a javascript function that is located in test1.jsp.
    In the test2.jsp page, it doesn't recognize the function that is located in test1.jsp page. Is there anyway to do this.

    test1.jsp:

    <html>
    <head>
    <script type="text/javascript">
    function test1()
    {
    alert("test1.jsp");
    }

    function test3()
    {
    alert("test3, called from test2.jsp but code locate at test1.jsp");
    }
    </script>
    </head>

    <body onresize="test1();">
    This is page 1.
    <iframe src="http://localhost:7001/test2/test2.jsp" id="dataFrame" style="height:942.0px;width:100%" scrolling="YES" frameborder="1"></iframe>

    </body>
    </html>
    test2.jsp:
    <html>
    <head>
    <script type="text/javascript">
    function test2()
    {
    alert("test2.jsp");
    }
    </script>
    </head>

    <body onresize="test2();test3();">
    This is page 2.

    </body>
    </html>
    If the above is not possible, is there another way to capture the event when a popup window is resize or maximize or mimize.
    I tried <body onresize="test1();"> it doesn't work. I event tried:
    window.onresize=test1 and it doesn't work.

    I tried <body onmove="test1();"> It partially works. When I miminize the popup window it triggers the event but when I maximize the popup
    window from a smaller popup window it doesn't trigger an event.

    Any hint or help or direction to an url would be greatly appreciated.

    Yours,

    Frustrated.

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    i'll just say you should be able to call functions from other windows. but you may have to put the onresize somewhere else like apart of the iframe that may work.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •