title: Replacing content_css in TinyMCE
body: <p>Is there a way to replace the content_css in TinyMCE?</p>
  
  <p>I have a single textarea on a page that is being used to edit HTML content that is dynamically loaded from a list of links using content returned from a server call as follows:</p>
  
  <pre><code>tinymce.get('contenteditor').setContent(json.content);
  </code></pre>
  
  <p>I also need to change the CSS in the TinyMCE editor for the different pages.  I'm doing the following just before the setContent:</p>
  
  <pre><code>tinymce.activeEditor.dom.loadCSS("tinyMCECSS?cssid=" + json.cssId);
  </code></pre>
  
  <p>Unfortunately, this is just adding the provided CSS to what is already loaded.  eg. if the first page CSS has</p>
  
  <pre><code>h1 {color: red;}
  </code></pre>
  
  <p>and the second page has:</p>
  
  <pre><code>h1 {color: blue;}
  </code></pre>
  
  <p>If I load the first page, the h1's are red.  If I then switch to the second page, they turn blue (as expected).  However, if I then go back to the first page, they remain blue.</p>
  
  <p>If the pages are loaded the other way round, then the reverse happens and I'm stuck with red.</p>
  
  <p>It appears that it's just appended the CSS with the loadCSS() function.</p>
  
  <p>Is there a way to remove the <strong><em>all</em></strong> of the first CSS before I replace it with the second file?</p>
  
  <p>I've tried clearing the content_css value, but it doesn't work and I don't think that's the right one :-)</p>
  
  <pre><code>tinymce.activeEditor.content_css = []
  </code></pre>
  
  <p>I've tried a complete reinitialisation (with tinymce.init()) at the time of updating the editor, but I'm still getting the combined CSS as described above.</p>
  
  <p>Thanks for your time :-)</p>