title: Error when I try to open a Jquery Dialog when a partial view is loaded into a Jquery Tabs
body: <p>On my Asp.net mvc webpage, I have three tabs. The first is for writing a message, the second for choosing recipient and the last for validation. </p>
  
  <ul>
  <li>On the first main tab, I have a button for open a preview for the message with a Jquery UI dialog popup</li>
  <li>On the second main tab, I load into another tab function, two views for
  charging each of my recipient list.</li>
  </ul>
  
  <p>I don't understand why I get an error "cannot call methods on dialog prior to initialisation; attempted to call method'open'", when I click on my preview button. I've made some test in my script file and I know, that's when I load a view on the second main tab that's the problem occur. I've made theses test :</p>
  
  <ul>
  <li>Change the calling method  </li>
  <li>Call a very simple partialview</li>
  <li>Open a basic dialog</li>
  <li>create another .js file for dialog</li>
  </ul>
  
  <p>If I delete <code>$('#AlertCreationTabs-1').html(result);</code> the preview popup works, but I get the error when I put this line back. I don't understand why it's not working.</p>
  
  <p>Script file :</p>
  
  <pre><code>$(function () {
      $('#dialogtest').dialog({
          autoOpen:false,
          closeOnEscape:true,
          show:'slow',
          modal:false,
      });
      $('#btnpreview').click(function() {
          $('#dialogtest').dialog("open");
      });
  });
  
  $(document).ready(function () {
      $("#AlertCreationTabs").tabs();
  });
  
  $(document).ready(function () {
      $.ajax({
          type: 'GET',
          dataType:'html',
          url: '/Panels/ViewTest',
          contentType:"text/html; charset=utf-8",
      }).success(function (result) {
          $('#AlertCreationTabs-1').html(result);
      });
  });
  
  $(function () {
      $('#AlertLog_AlertStartDate').datetimepicker({dateFormat:'dd/mm/yy'});
  });
  
  $(function () {
      $('#AlertLog_AlertEndDate').datetimepicker({dateFormat:'dd/mm/yy'});
  });
  
  $(document).ready(function () {
      $('#myTab').turbotabs({
          mode: 'vertical',
          width: '100%',
          padding: '0%',
          textColor: '#000000',
          navBackground: '#f0f6fa',
          backgroundColor: '#f0f6fa',
          hoverColor: '#FFFFFF',
          hoverBackground: '#fab300',
          activeBackground: '#fab300',
          navTextShadow: 'off'
      });
  });
  </code></pre>
  
  <p>View :</p>
  
  <pre><code>&lt;div id="dialogtest"&gt;Zogzog&lt;/div&gt;
   &lt;div id="myTab"&gt;
              &lt;ul class="tt_tabs"&gt;
                  &lt;li class="active"&gt;Composition&lt;/li&gt;
                  &lt;li&gt;Recipient&lt;/li&gt;
                  &lt;li&gt;Validation&lt;/li&gt;
              &lt;/ul&gt;
              &lt;div class="tt_container"&gt;
                  &lt;div class="tt_tab active"&gt;
                      @Html.AntiForgeryToken()
                      &lt;div class="panel-outerform"&gt;
                          &lt;div class="form-horizontal"&gt;
                              ...
                              &lt;div class="buttonbox"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;div class="col-md-offset-2 col-md-10"&gt;
                                          &lt;input type="button" id="btnpreview" value="Preview" class="btntemplate" /&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="tt_tab"&gt;
                      &lt;div class="panel-outerform"&gt;
                          &lt;div class="form-horizontal"&gt;
                              &lt;div class="tab-title"&gt;
                                  &lt;h3&gt;Please Choose Recipient for this alert&lt;/h3&gt;
                              &lt;/div&gt;
                              &lt;div id="AlertCreationTabs"&gt;
                                  &lt;ul&gt;
                                      &lt;li&gt;&lt;a href="#AlertCreationTabs-1"&gt;IP group&lt;/a&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;a href="#AlertCreationTabs-2"&gt;PC group&lt;/a&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                                  &lt;div id="AlertCreationTabs-1"&gt;
                                  &lt;/div&gt;
                                  &lt;div id="AlertCreationTabs-2"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
          ...
  </code></pre>
  
  <p>EDIT : Ok, now it's working, but I get another error, I wish to launch a Ticker script (jnewsticker) when the dialog is open. I've tried to add this in <code>opt</code> :</p>
  
  <pre><code>    open:function (event,ui) {
          var separator ...
          var title ...
          var startdate ...
          document.getElementByid('alertdata').innerHTML = ... 
          $('#newsticker_1').newsticker({
              'showControls':false,
          });
     ),
  </code></pre>
  
  <p>I get an error <code>TypeError:$(...).newsticker is not a fucntion</code>. Ticker works with classical <code>$('#dialogtest').dialog...</code> . I guess that I must call this open event differently</p>