I have this very old JS that worked in IE8 that was doing this:

window.document.getElementById("frameModalityList")


Here is what I want to fetch:

&lt;iframe name="frameModalityList" src="iframe_advanced_list.jsp" frameborder="0" marginheight="0" marginwidth="0" class="advanced_list" width="100%" height="300"&gt;&lt;/iframe&gt;


Now, when I try it in IE9/10, Chrome, I get an error:


  SCRIPT5007: Caught exception occurred : Unable to get property 'contentWindow' of undefined or null reference 


What is the new proper way to get the IFRAME element?


Question: What's a common mechanism for emailing in the background?
Answer: Not sure how common it (good practise) is but sending an email is a typical asynchronous process. One that can take several seconds and beyond. This makes it a perfect candidate for the use of messaging queue. 

The delivery method is of secondary importance but third party providers such as SendGrid (for transactional emails - forgotten password, invoice etc) or MailChimp (for newsletters and marketing) offer good value and has proven reliable.

By messaging queue I mean RabbitMQ (AMQ), ZeroMQ, Gearman, AWS SQS etc
Those can be used for any sort of information exchange between applications. In this case it's an information that certain email needs sending.

In terms of delivery information this can be obtained through an API with such provider or with more expensive plans through callback.