title: Where does JavaScript sit in the MVC pattern of a web application?
body: <p>I'm still confused about where JavaScript code sits in the MVC pattern when building a web application. I thought it worked like this. </p>
  
  <ul>
  <li>The Model is the database and the
  classes required to get the data
  in/out.</li>
  <li>The Controller would be the Classes where I write my logic
  that is, Java servlets, which accept an
  Ajax request and then make a call to
  the database;</li>
  <li>The View is the JSP page which is
  returned to the Ajax request via the
  servlet (my Controller)</li>
  </ul>
  
  <p>Because JavaScript code is compiled in the browser I think of it as part of the View, but it's handling user inputs, making server requests based on those events and then returning the data to page, so would that also make in part of the Controller?</p>
  
  <p>Also, what does it mean when they refer to the Domain Model in MVC?</p>