title: How do I update content in a Leaflet popup?
body: <p>I'm working with <a href="http://mapbox.com/wax">Wax</a> with <a href="http://leaflet.cloudmade.com/">Leaflet</a>. I'm setting up a map of the US, drawing state boundaries with GeoJSON using leaflet's L.GeoJSON.</p>
  
  <p>I'm able to get everything set during the map load, but I need to be able to adjust the content in the popups after the map is drawn.  Here's a stripped down version of what I'm doing:</p>
  
  <pre><code>var gjStates = new L.GeoJSON(null, null);
  wax.tilejson(url, function(tilejson) {  
      map = new L.Map('map').addLayer(new wax.leaf.connector(tilejson)).addLayer(gjStates);
  
      gjStates.on("featureparse", function (e) {
          if (e.properties &amp;&amp; e.properties.name){
              pops[e.id.substring(4)] = e.layer.bindPopup('&lt;h4&gt;Hello ' + e.properties.name + '!&lt;/h4&gt;');
          }
      });
      for (s in usStateData) {
          gjStates.addGeoJSON(usStateData[s]);
      }
  });
  </code></pre>
  
  <p>Now, everything draws fine, popups have good conent, but then I want to alter it later and there's no way to reference it.  I saw in the source that bindPopup() returns 'this', which I thought was the L.Popup object, but ended up something else.  So for instance, the following code will udpate the active popup, not the specific one for the specific L.Path object(state) I'm trying to get at.</p>
  
  <pre><code>pops['AK']._map._popup.setContent('I am ALASKA!');
  </code></pre>
  
  <p>Digging through the DOM with firebug, I can also see that the popup content is set in an internal variable and I can update it.  However, updating this does not update the HTML, and there's no way for me to find out that Alaska has the key of 52.  _layers[52] also does not have the setContent() method I'd hope for if it was an L.Popup object.</p>
  
  <pre><code>gjStates._layers[52]._popupContent = 'I am ALASKA!';
  </code></pre>
  
  <p>So, I'm kind of stuck and not finding what I need.  Is there any way for me to reference, and update the content for, a specific popup on the map after the initial rendering?</p>