title: Can't get ClientContext.executeQuery() to work in javascript
body: <p>I am getting information from a sharepoint list and then I want to use that data. The problem is that I need the data to be updated from the Sharepoint server before I use it, but I can't get executeQuery() to work. I can get executeQueryAsync() to work though. Here is my code:</p>
  
  <pre><code>// Global variables;
  var context;
  var web; 
  var list;
  var howManyItem = 0;
  var allItems;
  var randNums = [];
  
  // Initializes the variables; Sets listname; Gets all items; 
  function init(){
  
      context = new SP.ClientContext.get_current();
      web = context.get_web();
  
      // Enter the list name;
      this.list = web.get_lists().getByTitle('LetsTalkAdded');
  
      // Get item count in the query/list;
      var query = SP.CamlQuery.createAllItemsQuery();
      allItems = list.getItems(query);
      context.load(allItems, 'Include(Title)');
      context.executeQueryAsync(Function.createDelegate(this, this.success), Function.createDelegate(this, this.failed)); 
  }
  </code></pre>
  
  <p>This works fine, but when I change the last line to:</p>
  
  <pre><code>context.executeQuery(Function.createDelegate(this, this.success), Function.createDelegate(this, this.failed)); 
  </code></pre>
  
  <p>It no longer works, but I can't run them asyncronously. If I do, the parts of my code that depend on that information don't work. Why doesn't the executeQuery() funcion work?</p>