title: Replace div with JQuery from another controller-view
body: <p>Imagine I have the following 'partial' which is generated through a bunch of views:</p>
  
  <pre><code>&lt;div id="funstuff"&gt;
  &lt;div&gt;1&lt;/div&gt;
  &lt;div&gt;2&lt;/div&gt;
  &lt;div&gt;3&lt;/div&gt;
  &lt;div&gt;4&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Through the usage of codeigniter, I can reuse views (which I do a lot), and I would like to dynamically replace the 'funstuff' div with the contents from another view. Its controller method is still in the same class:</p>
  
  <pre><code>class FunnyThings extends CI_Controller {
  
     public function index() {
     $this-&gt;load-&gt;view('funpage_view');
     }
  
     public function funview() {
     $this-&gt;load-&gt;view('fun_partial_view');
     }
  }
  </code></pre>
  
  <p>Basically, with Jquery I can replace that view with different content:</p>
  
  <pre><code>$('#funstuff').replaceWith('&lt;div&gt;&lt;h2&gt;New heading&lt;/h2&gt;&lt;/div&gt;');
  </code></pre>
  
  <p>However, how can I get the content from the other view, dynamically and replace it with the div I've selected? </p>
  
  <p>Thanks,</p>