www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript Child window problem

  1. #1
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    5

    Javascript Child window problem

    Hi all,

    i have a small query i have a window from where i am opening up a pop up window using the below mentioned code

    Code:
    popup=window.open ('CreateJob.action', 'CreateJob','toolbar=1 resizable=1 width=640, height=540')
    it is opening up A pop up window.
    there is one cancel button in the pop up window which will close pop up window and second way a user can close pop up window using "X"

    i want to capture these 2 events in paretns window so that when a user close a pop up window i can catch the event in parent window and can apply my logic in parent window as per my requirements

    thanks in advance
    Regards,
    Umesh

  2. #2
    Join Date
    Oct 2006
    Posts
    939
    from your opened window call the parent like-
    <input onclick="opener.close()" type=button>

    You can also redefine variables in the parent too-

    <body onbeforeunload="opener.openerVar='newValue'">

    If the parent is no longer there because you closed it, an error occurs.
    So, you need to check for the parent-
    <body onbeforeunload="if(opener){opener.openerVar='newValue'}">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles