title: Dynamic JQuery mobile popup with Ajax JSON
body: <p>I have an MVC 4 mobile website.  The first page has a popup that needs to display a large amount of text coming from the controller via an AJAX request.</p>
  
  <p>In the controller:</p>
  
  <pre><code>[HttpPost]
  public ActionResult GetLongText()
  {
      return Json(OurState.GetLongText);
  }
  </code></pre>
  
  <p>Which will just return what is in the error function on the jsfiddle:
  <a href="http://jsfiddle.net/TyhnV/28/" rel="nofollow">http://jsfiddle.net/TyhnV/28/</a></p>
  
  <p>The first click of the button will show the popup off to the side, the second click will properly center it to the window.
  I need to know how to create the popup dynamically so that the first click of the button will get the right window position for the popup, rather than misplacing it because of the size of the text being placed in it.</p>