title: Get ID of Selected List Item
body: <p>I am trying to get the ID of a selected list item using JavaScript. Basically I am trying to get the ID using JavaScript and then in the same javascript redirect to a page with the selected ID in the querystring.</p>
  
  <p>This is my javascript:</p>
  
  <pre><code>function GetID() {
      var ctx = SP.ClientContext.get_current();
      var items = SP.ListOperation.Selection.getSelectedItems(ctx);
      window.location.href = "/_layouts/CustomApplicationPage/CustomApplicationPage.aspx?ID=" + items;
  }
  </code></pre>
  
  <p>But the results I get in my querystring are:</p>
  
  <pre><code>CustomApplicationPage.aspx?ID=[object Object]
  </code></pre>
  
  <p>Does anyone know how to get the ID of the selected list item or point me to the correct method to use in JavaScript?</p>
  
  <p>Thanks!</p>