0

I require to open 2 popup windows and first one contain a button to open second which use to open a pdf. here if i made few changes in values(it contain textbox) on button click to open second it reload the second. but focus not transfer to second window.

I attach old post here which i try but still same problem I have.

I think I've got a better solution that doesn't involve closing the window first. The issue is that IE won't override a window (PDF or otherwise) if you attempt to open it again with an empty URL (i.e., ''). It will override a PDF with a non-empty URL, however. That could be a file, but about:blank works even better (which is what an empty URL does normally).

Depending on how your code is written, you may still want the try/catch, but this should eliminate the need:

windowHandle = window.open('about:blank',name,attributes);
windowHandle.document.location.href = url;
windowHandle.focus();

about:blank will force the PDF out of the child window and allow you to do what you need to do. It might not be a bad idea to place the setting of the URL and focus() in a windowHandle.onload() handler, so there aren't any timing issues with disposing of the PDF. I.e.:

windowHandle.onload=function(){
    windowHandle.document.location.href = url;
    windowHandle.focus();
};

Thanks

My main problem is calling windowHandle.focus(); which generate error with pdf.

Roomy
  • 451
  • 1
  • 4
  • 7
  • I want to transfer focus to second popup even it already exist. with focus() it generate error member not found/permission error.(Here I point out second popup used to open pdf. – Roomy Jan 15 '13 at 07:35
  • Can you find your answer here: http://stackoverflow.com/questions/7243970/access-a-window-by-window-name or here: http://stackoverflow.com/questions/9364807/javascript-reference-browser-window-by-name – Christiaan Westerbeek Jan 15 '13 at 07:51
  • its here: http://stackoverflow.com/questions/987572/opening-a-popup-in-ie-member-not-found – Roomy Jan 15 '13 at 07:55
  • One more point is if I avoid to use window.focus() javascript error remove but focus did not transfer to that window which i try to implement. – Roomy Jan 16 '13 at 04:15

0 Answers0