By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

Closing child window inParent window.

P: 3
Hi Experts,

I want close child window from parent window after opening/saving text document.I don't have child window code.So no control over child window in parent. I am trying to access properties & methods of child window but getting error "Permission Denied".
Closing of child window is fine but i am not getting child window event in parent. I mean how to know that child window has completed task.

My code is as below:

Expand|Select|Wrap|Line Numbers
  1. function checkWindow() {
  2.             if (childWindow) {
  3.                 window.clearInterval(intervalID);
  4.                 childWindow.close();
  5.             }
  6.         }
  7.  
  8.   $(document).ready(function () {
  9.             if ($("#ReportUrl").val() != "") {
  10.                 var url = $("#ReportUrl").val();
  11.           debugger;
  12.                 childWindow = window.open(url);
  13.  
  14.  
  15.                 intervalID = window.setInterval(checkWindow, 500)
  16. }
This is immediately closes window. And also i don't want to use timer.

Regards,
Shilpa
Jul 25 '14 #1
Share this Question
Share on Google+
4 Replies


Dormilich
Expert Mod 5K+
P: 8,639
Closing of child window is fine but i am not getting child window event in parent.
of course not. window is the endpoint of all events. everything else would be a security risk.

I mean how to know that child window has completed task.
the child window hast to notify the parent window explicitly
e.g. via https://developer.mozilla.org/en-US/...ow.postMessage
Jul 25 '14 #2

P: 3
Hi Dormilich ,

Thanks for your reply.

I went through the link. But problem is that i don't have control over client script as client script is not with me.

I am just calling window.open(childurl) function in parent.


Regards,
Shilpa
Jul 31 '14 #3

Dormilich
Expert Mod 5K+
P: 8,639
But problem is that i don't have control over client script as client script is not with me.
then you can do nothing if you cannot change the JS files.
Jul 31 '14 #4

P: 3
Hi Dormilich,

Thanks for your reply.

Regards,
Shilpa
Aug 1 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.