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

refresh parent window on load of child window

P: 10
Hello Experts,

i've to open child window whose content type is "application/pdf";

Now i want to refresh the parent window after loading of the child window.
My problem is that i can not write any javascript in the child window since its content type is 'application/pdf' [Javascript does not works here].

what to do in parent window to know that pdf file is filly opened in child window so that i can refresh it???
please help me to find the solution for this problem.

Thanks in advance

Mina
May 5 '08 #1
Share this Question
Share on Google+
4 Replies


P: 46
Hello Experts,

i've to open child window whose content type is "application/pdf";

Now i want to refresh the parent window after loading of the child window.
My problem is that i can not write any javascript in the child window since its content type is 'application/pdf' [Javascript does not works here].

what to do in parent window to know that pdf file is filly opened in child window so that i can refresh it???
please help me to find the solution for this problem.

Thanks in advance

Mina
Hi,

the following code will helps....

Expand|Select|Wrap|Line Numbers
  1. var new_window = window.open(url);
  2. do{
  3.      status = new_window.document.readyState;
  4. }while(status != "complete")
From the above code, "do" loop will execute until your child window loaded fully.
So, you have to write the code (to execute after child window loads) after "do" loop

Hope this helps.
May 5 '08 #2

P: 10
Hi,

the following code will helps....

Expand|Select|Wrap|Line Numbers
  1. var new_window = window.open(url);
  2. do{
  3.      status = new_window.document.readyState;
  4. }while(status != "complete")
From the above code, "do" loop will execute until your child window loaded fully.
So, you have to write the code (to execute after child window loads) after "do" loop

Hope this helps.

Hi Velhari,

Thanks for the reply.
You are right, but this code works fine pop-up contains html text
but my popup displays a pdf and it gives javascript error to me i.e
"Permission Denied"

i dont know the reason for this. please help???

Mina
May 5 '08 #3

P: 10
Hi,

the following code will helps....

Expand|Select|Wrap|Line Numbers
  1. var new_window = window.open(url);
  2. do{
  3.      status = new_window.document.readyState;
  4. }while(status != "complete")
From the above code, "do" loop will execute until your child window loaded fully.
So, you have to write the code (to execute after child window loads) after "do" loop

Hope this helps.
Hi Velhari,

In the case of PDF i've to write a little modified code

do{
status = win.document.readyState;

}while(status != "interactive")

Now it seems to work fine, i've to test it and analyse.

Regards
Mina
May 5 '08 #4

P: 10
Hi Velhari,

Thanks a lot it worked for me.

Mina
May 5 '08 #5

Post your reply

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