title: How to Get args from SP.UI.ModalDialog?
body: <p>I have tried other online suggestions without success.</p>
  
  <p>So...</p>
  
  <p>My function opening a SharePoint dialog passes <code>agrs</code> into the prescribed <code>option</code> object, like so:  </p>
  
  <p><strong>SETTING UP THE DIALOG:</strong><br/>
  Nothing magical here...</p>
  
  <pre><code>    function openEmailDialog() {
          var options = SP.UI.$create_DialogOptions(),
              url = '../Pages/EmailDocument.aspx';
  
          options.title = "Email Documents";
          options.width = 1024;
          options.height = 400;
          options.allowMaximize = false;
          options.url = url;
          options.args = {  DidYouGetThis: true };
  
          SP.UI.ModalDialog.showModalDialog(options);
      };
  </code></pre>
  
  <p>Next...</p>
  
  <p>Upon opening the target URL, most online examples recommend the following JavaScript to extract the <code>args</code> BACK from the dialog, like so:</p>
  
  <p><strong>GETTING THE ARGS:</strong><br/>
  Remember, this is JavaScript in a new page which was just opened as a dialog...</p>
  
  <pre><code>$(document).ready(function () {
      // This fails because "get_childDialog" doesn't exist
      var args = SP.UI.ModalDialog.get_childDialog().get_args();
  });
  </code></pre>
  
  <p>This fails because the <code>SP.UI.ModalDialog</code> object has no <code>get_childDialog</code> function.</p>