Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8246323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:28:07+00:00 2026-06-07T22:28:07+00:00

Possible Duplicate: MSIE and addEventListener Problem in Javascript? I am trying to listen for

  • 0

Possible Duplicate:
MSIE and addEventListener Problem in Javascript?

I am trying to listen for a close event on a child popup window that is called by its parent page. The idea is for a user to be able to fill out a form and then using a popup window accept permissions for and upload a video to YouTube.

The function I currently have works with Chrome but I cannot seem to get it to work on IE 8?

function ShowUploadVideoPopUp(URL){
    //get the top and left position that the popup should be placed in
    //half the screen width and height to center the popup
    var top = Math.max(0, (($(window).height()) / 2) + $(window).scrollTop()) - 210;
    var left = Math.max(0, (($(window).width()) / 2) + $(window).scrollLeft()) - 300;
    //generate an id for this popup
    day = new Date();
    id = day.getTime();
    //open the window
    var win = window.open(URL, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=420,left = ' + left + ',top = ' + top);
    //we need to set a timeout otherwise the unload event is called before the window is opened
    //dont ask me why!?!
    setTimeout(function(){
        //add an event listener to listen for closure of the popup window
        //call the video uploaded function when the window is closed
        win.addEventListener("unload", VideoUploaded, false);
    }, 500);
    return false;
}

The idea is that once the popup has closed I can submit a form on the parent page.

The error I get is:

‘Object doesn’t support this property or method’

which I guess means that me assigning the created window does not support me calling the addEventListener method.

Your help with this would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:28:09+00:00Added an answer on June 7, 2026 at 10:28 pm

    IE < 9 doesn’t support addEventListener instead use attachEvent

    setTimeout(function(){
        if(win.addEventListener) // w3c standard
            win.addEventListener("unload", VideoUploaded, false);
        else if win.attachEvent('onunload', VideoUploaded, false); // IE
        else win.onunload=VideoUploaded;
    }, 500);
    

    Here is an answer on SO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Javascript window resize event I want to get an event which is
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: JavaScript: why does parseInt(1/0, 19) return 18? Why does parseInt(1/0, 19) evaluate
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always
Possible Duplicate: How to call a JavaScript function from PHP? I have a php
Possible Duplicate: What is the difference between a function expression vs declaration in JavaScript?
Possible Duplicate: Opening url in new tab while i am doing window.open(), my page
Possible Duplicate: What is the most efficient way to clone a JavaScript object? (Most
Possible Duplicate: Parse C# string to DateTime I am facing a problem while converting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.