title: Backbone.js Double Rendering Issue
body: <p>I'm using Backbone.js to create an app. However it is rendering the code twice. It is as though the code is being run twice. I've looked for duplicate code and can't find anything that would run everything twice.</p>
  
  <p>An example of what happens is on init the body content is supposed to be wrapped by a div#app_container tag. But when I load the page it wraps in a div#app_container then wraps that in a dev#app_container tag.</p>
  
  <p>Also, if i put alert('test') in the 'initialize()' function it alerts "test" twice.</p>
  
  <p>Does that make sense? </p>
  
  <p>-- EDIT --</p>
  
  <p>After playing around with code I've found that if I remove the line which wraps everything in the body then the problem stops. So there is something in wrapInner or affecting the body that is causing the code to be run twice. </p>
  
  <p>Problem code:</p>
  
  <pre><code>$("body").wrapInner('&lt;div id="app_container" /&gt;');
  </code></pre>
  
  <p>Here is the code for my app JS file:</p>
  
  <pre><code>(function ($) {
  
    window.AppView = Backbone.View.extend({
  
      self: this,
  
      el: $("body"),
  
      defaults: {
          current_selected: "",
          last_selected: "",
          toggle: 0,
          Messages: "", 
          latest_template: "",
      },
  
      events: {
          "click #annotate_app_container" : "select"
      },
  
      initialize: function()
      {
          $("body").wrapInner('&lt;div id="app_container" /&gt;');
          $.get('/assets/includes/ajax.php', function(data){
              $("#app_container").after(data);
          });
      },
  
      select: function (e) {
  
          e.preventDefault();
  
          // Code goes here
      },
  
    });
  
  window.App = new AppView;
  
  })(jQuery);
  </code></pre>
  
  <p>This files I am including on the page are as follows:</p>
  
  <pre><code>    &lt;script type="text/javascript" src="/assets/js/json2.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/assets/js/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/assets/js/underscore.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/assets/js/backbone.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/assets/js/mustache.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/assets/js/app.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Let me know what you think it is.</p>