title: KO ReferenceError: Unable to process binding
body: <blockquote>
    <p><em>Uncaught ReferenceError: Unable to process binding "foreach: function (){return Educations }"</em></p>
    
    <p><em>Uncaught ReferenceError: Unable to process binding "foreach: function (){return WorkExperience }"</em></p>
  </blockquote>
  
  <p>I couldn't figure out why the binding is failing.</p>
  
  <p>i have the following two tables one for Education and other for Work Experience, They give the error when i'm trying to bind the both table in one view, If i remove the binding (JS + HTML code)  it works fine</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div id=divtable1 class="widget widget-simple widget-table"&gt;
     &lt;table id="Table1" class="table table-striped table-content table-condensed boo-table table-hover"&gt;
        &lt;thead&gt;
           &lt;tr id="Tr1" class="filter"&gt;
              &lt;th&gt;University&lt;span class="required"&gt;*&lt;/span&gt;&lt;/th&gt;
              &lt;th&gt;Location &lt;span class="required"&gt;*&lt;/span&gt;&lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
           &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody data-bind='foreach: Educations'&gt;
           &lt;tr&gt;
              &lt;td&gt;&lt;input type="text" class='span11 required' data-bind="value: SchoolName" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" class='span11 required' data-bind="value: Location" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href='#' data-bind='click: $root.removeEducation'&gt;Delete&lt;/a&gt;&lt;/td&gt;
           &lt;/tr&gt;
        &lt;/tbody&gt;
     &lt;/table&gt;
     &lt;button data-bind='click: $root.addEducation' class="btn btn-blue"&gt;Add Education&lt;/button&gt;
  &lt;/div&gt;
  &lt;div id="divtable2"&gt;
     &lt;table id="Table2"&gt;
        &lt;thead&gt;
           &lt;tr id="Tr2" class="filter"&gt;
              &lt;th&gt;Employer Name&lt;span class="required"&gt;*&lt;/span&gt;&lt;/th&gt;
              &lt;th&gt;EmployerAddress &lt;span class="required"&gt;*&lt;/span&gt;&lt;/th&gt;
              &lt;th&gt;&lt;/th&gt;
           &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody data-bind='foreach: WorkExperience'&gt;
           &lt;tr&gt;
              &lt;td&gt;&lt;input type="text" class='span11 required' data-bind="value: EmployerName" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" class='span11 required' data-bind="value: EmployerAddress" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href='#' data-bind='click: $root.removeWorkExperience'&gt;Delete&lt;/a&gt;&lt;/td&gt;
           &lt;/tr&gt;
        &lt;/tbody&gt;
     &lt;/table&gt;
     &lt;button data-bind='click: $root.addWorkExperience' class="btn btn-blue"&gt;Add Work Experience&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Java Script:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var Educations = function (educations) {
  
          var self = this;
          self.Educations = ko.mapping.fromJS(educations);
  
          self.addEducation = function () {
              self.Educations.push({"SchoolName": ko.observable(""), "Location": ko.observable("")});
          };
  
          self.removeEducation = function (education) {
              self.Educations.remove(education);
          };
      };
  
      var viewModel = new Educations(@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.Educations)));
      ko.applyBindings(viewModel);
  &lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
      var WorkExperience = function (workexperiences) {
  
          var self = this;
          self.WorkExperience = ko.mapping.fromJS(workexperiences);
  
          self.addWorkExperience = function () {
              self.WorkExperience.push({ "EmployerName": ko.observable(""), "EmployerAddress": ko.observable("")});
          };
          self.removeWorkExperience = function (workexperience) {
              self.WorkExperience.remove(workexperience);
          };
      };
  
      var viewModel = new WorkExperience(@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.WorkExperience)));
      ko.applyBindings(viewModel);
  &lt;/script&gt;
  </code></pre>
  
  <p>Also I tried to bind Table1 but it didn't work</p>
  
  <blockquote>
    <p>ko.applyBindings(viewModel, $('#Table1')[0]);</p>
  </blockquote>