title: remove load() from div and return to original div contents?
body: <p>I've got most of what I want working, but this last bit requires I throw myself on the stackoverflow gods, because I'm stumped. I have a long list of sub-menu options. When a user clicks on one, it replaces another div's contents with new contents, and also marks the sub-menu li with class="active". This part works great, but the problem is undoing it. Here's the basic html:</p>
  
  <pre><code>&lt;div id="coleft"&gt;
  &lt;ul id="charactermenu"&gt;
      &lt;li id="base_chara" class="active"&gt;basic info&lt;/li&gt;
      &lt;li id="base_names" class=""&gt;names&lt;/li&gt;
      &lt;li id="base_speech" class=""&gt;speech&lt;/li&gt;
      &lt;li id="base_psyche" class=""&gt;psyche&lt;/li&gt;
      &lt;li id="base_personality" class=""&gt;personality&lt;/li&gt;
      &lt;li id="base_habits" class=" "&gt;habits&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div id="coright"&gt;
      /... some content goes here
  &lt;/div&gt;
  </code></pre>
  
  <p>And here's the simple script that takes the #id and flips the div contents:</p>
  
  <pre><code>$('#charactermenu li').click(function() {
      var selection = $(this).attr('id');
      $("#coright").html(ajax_load).load( selection + ".php").fadeIn();
      $("#" + selection).addClass('active');
      $("#" + selection).siblings().removeClass("active");
  }); 
  </code></pre>
  
  <p>When the page first opens, it shows as default the contents of #coright, which is #base_chara. But if I click onto something else and then back onto the first sub-menu option (#base_chara), it wants to load that div just like the rest. I've ended up duplication the #base_chara contents into a separate base_chara.php, so right now I have two files to track for that sub-menu option, ugh. It seems like there's got to be a way to something like this:</p>
  
  <pre><code>#base_chara click(function)
      remove loaded php from div
      display original div contents
      removeClass for everyone else
      add active for #base_chara
  </code></pre>
  
  <p>But when a div is replaced in this manner, does the original content get wiped? What's the easiest/best way to manage this? Unload() seems to be related to the entire window (not just a div), and remove() and empty() leave me with nothing in #coright at all. Where am I going wrong?</p>
  
  <p>ETA: I just realized I could get around this one by using require_once('dbconnect.php') instead of simple include. Which is to say, the problem is resolved but the question remains unanswered, and I'd still like to know if there is a simple way to handle this on a jquery/javascript level. Thanks!</p>