title: Unable to get property of undefined or null reference
body: <p>This is similar to my last question but the problem is different.  I use a separate javascript file for all of my javascript functions.  That file is called by my main window, and is also called in a separate instance by my child windows.  My code works with every browser except IE 9 and 10.  I have not tested earlier versions of IE.</p>
  
  <p>IE says the offending line is <code>window.opener.savetoparent($targetval);</code>  My previous code was <code>opener.savetoparent($targetval);</code> and before that I simply made the changes to the parent from the child directly.  I have also gone into IE and enabled protected mode as suggested in another article with no change in behavior.  <code>Savetoparent()</code> is available to both the child and the parent so I must call it with opener for it to run in the parent.</p>
  
  <p>The error I am getting is : <code>Unable to get property 'savetoparent' of undefined or null reference.</code>  Here is the code:</p>
  
  <pre><code>function saveandclose($wintype, $propid) {
  
  switch($wintype) {
      case 'ccdetail':
          var $targetval = $('#cc-total').val();
          var $fieldname = 'closingcoststotal';
          break;
  }
  
  window.opener.savetoparent($targetval);
  closewindow();
  }
  </code></pre>
  
  <p>The safe to parent function is:</p>
  
  <pre><code>function savetoparent($targetval) {
      $('#' + $parentloc).val($targetval);
      var $name = $('#' + $parentloc).attr("name");
      var $rawtargetval = jsstrtonum($targetval);
      processrvsave($propertyid, $name, $rawtargetval);   
      calcrvtotals();
  }
  </code></pre>
  
  <p>Any light you can shed on this would be greatly appreciated.</p>
  
  <p>window is launched like this</p>
  
  <pre><code>if(window.showModalDialog) { 
    window.showModalDialog($childname + '.php?ploc=' + $parentloc + '&amp;propid=' + $propid, '', 'dialogWidth: ' + $winwidth + 'px; dialogHeight: ' + $winheight + 'px;') 
  } 
  else { 
    window.open($childname + '.php?ploc=' + $parentloc + '&amp;propid=' + $propid, '', 'width=' + $winwidth + ', height=' + $winheight + ', modal=yes'); 
  } 
  </code></pre>