title: SP.js "Uncaught TypeError: Object [object Object] has no method 'get_staticObjects'"
body: <p>I am trying to write a small SPA that acts as a UI layer for a SharePoint list.</p>
  
  <p>I have successfully done so with a regular AJAX call, but, due to the limitations of that method, I now want to do so with the JavaScript Object Model.</p>
  
  <p>The problem I am encountering is an error with SP.js (from the title):</p>
  
  <p>*Uncaught TypeError: Object [object Object] has no method 'get_staticObjects'*</p>
  
  <p>This pretty much prevents me from even getting to the script.</p>
  
  <p>Here is the code for the page:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;JavaScript Object Model Test&lt;/title&gt;
  
      &lt;script type="text/javascript" src="js/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/knockout-2.3.0.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="/_layouts/MicrosoftAjax.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/_layouts/1033/init.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/_layouts/SP.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/_layouts/SP.Core.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type="text/javascript"&gt;
      var siteUrl = '/sites/MySiteCollection';
      function retrieveListItems() {
          var clientContext = new SP.ClientContext(siteUrl);
          var oList = clientContext.get_web().get_lists().getByTitle('Announcements');
          var camlQuery = new SP.CamlQuery();
          camlQuery.set_viewXml('&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Geq&gt;&lt;FieldRef Name=\'ID\'/&gt;' + 
              '&lt;Value Type=\'Number\'&gt;1&lt;/Value&gt;&lt;/Geq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;RowLimit&gt;10&lt;/RowLimit&gt;&lt;/View&gt;');
          this.collListItem = oList.getItems(camlQuery);
          clientContext.load(collListItem);
          clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));       
      }
  
      function onQuerySucceeded(sender, args) {
          var listItemInfo = '';
          var listItemEnumerator = collListItem.getEnumerator();
          while (listItemEnumerator.moveNext()) {
              var oListItem = listItemEnumerator.get_current();
              listItemInfo += '\nID: ' + oListItem.get_id() + 
                  '\nTitle: ' + oListItem.get_item('Title') + 
                  '\nBody: ' + oListItem.get_item('Body');
          }
          alert(listItemInfo.toString());
      }
      function onQueryFailed(sender, args) {
          alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
      }
      ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js");
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I run that, nothing happens, but the console outputs the error above.</p>