title: Meteor: how to update DOM via Javascript without a page refresh?
body: <p>UPDATE:</p>
  
  <p>It looks like <a href="https://stackoverflow.com/questions/10274679/invoke-a-client-js-function-in-meteor-after-getting-results-from-the-server">this script</a> may be the catalyst I'm looking for. Will test it and answer/close this question if so.</p>
  
  <hr>
  
  <p>I'm sure I'll find the answer to this eventually, but I'm putting it out there now, in case someone else knows it right off...</p>
  
  <p>I am using RaphaelJS to manipulate the DOM (adds a bunch of <code>SVG</code> tags to an identified <code>DIV</code>), and I want to re-render those specific DOM parts, if there's an update to the MongoDB collection.</p>
  
  <p>As an example:
  -Let's say that I have a collection called <code>PiePieces</code>.
  -When the page is first rendered/ called, let's pretend that the number of pieces in the collection is 4.
  -I programmatically add a pie piece using console: <code>PiePieces.insert({...})</code>
  -I want the page to update like it would for a standard handlebars binding situation, but the problem is, the new entry needs to go through the Raphael script, which performs direct DOM manipulation. </p>
  
  <p>So, the logic would go something like this:</p>
  
  <p>MongoDB collection update event -> Client function call to manipulate DOM  -> DOM modified/ page updated without a refresh.</p>
  
  <p>I've tried implementing this by reading values from the DOM itself, and I can get the updated DOM, but the entire page refreshes and/or I have to manually refresh the page, OR the DOM tree isn't completed yet, and so it's blank until I refresh.</p>
  
  <p>Can you point me in the right direction, maybe with a small code snippet/example?
  (if something similar already exists, just tell me where and I'll go digging)</p>
  
  <p>Thanks in advance! (I am LOVING Meteor so far...) </p>