title: Using Primefaces JavaScript to call a JSF method on a bean on the server
body: <p>In the Primefaces User Guide it shows examples of how to make AJAX calls to the server</p>
  
  <pre><code>PrimeFaces.ajax.AjaxRequest('/myapp/createUser.jsf',
  {
      formId: 'userForm',
      oncomplete: function(xhr, status) {alert('Done');}
  });
  </code></pre>
  
  <p>What I can't figure out is how to call a particular method.  My goal is to invalidate the session from the client using JavaScript.</p>