title: backbone.js ajax calls
body: <p>I 'm learning Backbone.js for a new app I'm building.
  I need to perform an AJAX call(<code>REST SERVICE</code>) to authenticate.</p>
  
  <p>Where is the correct place for this call? In the Model, View or somewhere else? specifically related to Backbone.js MVC model.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="lib/jquery-1.6.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="lib/json2.js"&gt;&lt;/script&gt;
  &lt;script src="lib/underscore-min.js"&gt;&lt;/script&gt;
  &lt;script src="lib/backbone-min.js"&gt;&lt;/script&gt;   
  
  &lt;script language="javascript"&gt;
        $(function(){
           var LoginView = Backbone.View.extend({
            el: $("#login-form"),
  
            events: {
              "click #login": "login"
            },
  
            login: function(){
                alert("Hello");
             }
          });
  
          window.LoginView = new LoginView();
        });
      &lt;/script&gt;   
    &lt;/head&gt;
    &lt;body&gt;
      &lt;form action="/login" id="login-form"&gt;
        Username: &lt;input type="text" id="username"&gt;&lt;br&gt;
        Password: &lt;input type="password" id="password"&gt;&lt;br&gt;
        &lt;button id="login"&gt;Login&lt;/button&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>