title: SharePoint 2010: JavaScript error when creating Modal Dialog?
body: <p>For some reason, my SharePoint's modal dialog doesn't work properly. The error I get is this: </p>
  
  <ul>
  <li>In Firefox: <code>SP.UI.$create_DialogOptions is not a function</code></li>
  <li>In IE: <code>Object doesn't support this property or method</code></li>
  </ul>
  
  <p>Here is my code:</p>
  
  <pre><code>var options = SP.UI.$create_DialogOptions();
  options.width = 525;
  options.height = 300;
  options.url = '/_layouts/mywork/richtexteditor.aspx';
  options.dialogReturnValueCallback = Function.createDelegate(null, function (result, value)
  {
      alert(result + value);
  });
  
  SP.UI.ModalDialog.showModalDialog(options);
  </code></pre>
  
  <p>Interestingly, when I inspect the SP.UI in Firebug, I don't see all the methods and properties.  </p>
  
  <p>NOTE: I am using standard Webpart (not visual) and not an application page.</p>