title: How to Silverlight Invoke Javascript function in a namespace?
body: <p>I'm having a problem since I wrapped my javascript functions inside of a namespace. 
  Version 1 of my code worked fine.  Originally, to call the javascript from inside Silverlight I used to use this code:</p>
  
  <pre><code>HtmlPage.Window.Invoke("hideMyDiv");
  </code></pre>
  
  <p>My javascript looked like this:</p>
  
  <pre><code>function hideMyDiv() {
  $('#MyDiv').fadeOut();
  </code></pre>
  
  <p>}</p>
  
  <p>Now, I've refactored my javascript to be contained in a namespace.  So it now looks like this:</p>
  
  <pre><code>var activity = {
  message: null,
  hideMyDiv: function() {
      $('#MyDiv').fadeOut();
  }   };
  </code></pre>
  
  <p>I can call this refactored function in javascript, it works like before:</p>
  
  <pre><code>$("document").ready(function() {
  activity.hideMyDiv();   });
  </code></pre>
  
  <p>But when I try to use it from Silverlight, I get this error:  Failed to Invoke: activity.updateInfo.  This is my current Silverlight code:</p>
  
  <pre><code>HtmlPage.Window.Invoke("activity.hideMyDiv");
  </code></pre>
  
  <p>What am I doing wrong?  (and thanks!)</p>