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

  • SEARCH
  • Home
  • 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 8874139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:38:38+00:00 2026-06-14T18:38:38+00:00

I am a JS noob, so please excuse me if this question is too

  • 0

I am a JS noob, so please excuse me if this question is too “noobish”.

Note: the function is long, but just scroll down till you see //********* as that’s the important part.

My function:

function ShowWindowN(userId,url,width,height,courseId) {
  var iev=getIEVer();
  if(iev>=6&&iev<8){
    width+=16*1;
  }
  var w=screen.availWidth<width?screen.availWidth:width;
  var csCookie=readCookie('course_settings_'+userId);
  var found=false;
  if(csCookie!=null){
    csCookie=eval('({'+csCookie.replace(/&/g,',').replace(/=/g,':')+'})');
    if(csCookie[courseId]!=null){
      height+=1*csCookie[courseId].height;
      found=true;
    }
  }
  if(!found){
    var plCookie=readCookie('player_settings_'+userId);
    if(plCookie!=null){
      plCookie=eval('({'+plCookie.replace(/&/g,',').replace(/=/g,':')+'})');
      height+=1*plCookie.window_extra_height;
    }else{
      height+=16;
    }
  }
  var h=screen.availHeight<height?screen.availHeight:height;
  var left = (screen.availWidth/2)-(w/2);
  //************
  objMovieWindow=window.open(url, "movieWindow", "width=" + w + ", height=" + h + ", top=0, left="+left+", status=false, toolbar=false, menubar=false, location=false, directories=false, scrollbars=1, resizable=1"); 
  objMovieWindow.focus();
  //alert(objMovieWindow.name);
};

If you look at the alert() on the 2nd last line, that does not work, it gives me a “permissions denied” error. I also have a function that says “close_me()” with just this:

objMovieWindow.close();

But that does not work and gives me an “undefined” error. Basically, I load the page, and click a link to launch the popup, then the parent page reloads, and by clicking a link on the parent page I want to close the popup.

Please tell me how I can close the damn popup window?

  • 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-14T18:38:40+00:00Added an answer on June 14, 2026 at 6:38 pm

    When you reload the page you are losing the reference to objMovieWindow, so you won’t be able to call objMovieWindow.close(). You’ll have to avoid reloading the page if you want to close the window.

    UPDATE

    One work around would be to call window.open() again with the same name, and call close() on the reference returned from that.

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

Sidebar

Related Questions

Please excuse the noob-ish nature of this question. I have a project in which
Excuse the 'noob' question, but can someone please explain the way ASP.NET's buttons work.
I'm new to EF so please excuse me if this is a noob question.
Pardon me, this really is a noob question but please understand that I do
This maybe a noob question but please help me. I found a library called
Please excuse me if this is a noob question. I have tried every possibility
I'm a noob so please forgive if this is an easy question but I'm
Please excuse me for stupid question, but I am a noob in javascript and
I'm a Grails noob so please excuse my noob question. I've created a domain
Sorry if this is a stupid noob question please be gentle with me I'm

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.