Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JavaScript - Is opener.document.getElementById() Necessary?

485418Nov 3 2009 — edited Nov 3 2009
I have a JS script in the Page HTML Header of a page that I open as a pop-up, that runs a page process and then closes the pop-up. It works fine in FF but in IE it throws an error. Here's the code,
<script language="JavaScript">
   function passBack()
   {
   doSubmit('SAVE_TASK');
   window.opener.location.reload(true);
   opener.document.getElementById('P2048_CUST_NBR').focus();
   this.close();
   }
</script>
and here's the error:
Error: 'opener.document.getElementById(...)' is null or not an object
I got this from another post a few weeks ago. I wish I could remember which one so I could thank the contributor, but alas, that was too long ago. Anyway, I do my development in FF and since this is an in-house app. and most of the users use FF we don't put a lot of emphasis on testing in every browser out there. We just turned this app on to one of our IE users and discovered the error.

I have commented out the offending statement and things seem to work OK, but can anyone turn me onto the potential problem(s) with taking this line out?

Thanks,

Gregory
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2009
Added on Nov 3 2009
5 comments
977 views