title: How to set a global variable so to keep data related to multiple jQuery objects?
body: <p>I am using jQuery and jQuery UI, and I am almost new to JavaScript. I would like to set a global variable in the <code>window</code> object so to keep custom data related to multiple jQuery objects. That is, at this time I am using the following (poor) code:</p>
  
  <pre><code>// Given
  window.myDataObject = {};
  
  // Then, in the same file, I run multiple times (one time for each 'tag_id_1', 
  // 'tag_id_2', ..., 'tag_id_N') the following code
  var tag      = $('#tag_id_N')
  myDataObject = { pagination: { page : 1, per_page: 10 } } // This aims to keep pagination data for tags.
  </code></pre>
  
  <p>Since I am trying to keep data for <em>multiple</em> <code>tag</code>s, running the above code multiple times makes the <code>window.myDataObject</code> to be continuously "re-initialized" (making the keeping process inefficient). Because that, I thought to add "namespaced" <em>properties</em> (maybe, namespaced with "something" related to each <code>tag</code> object) to <code>window.myDataObject</code> so that each <code>tag</code> has its own pagination data.</p>
  
  <p>How can I make that? Is that approach a "good" / "proper" way to proceed?</p>