title: Problems identifing which page is active after loading same html page multiple times in same document
body: <p>I have a main page that looks like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="main"&gt;
    &lt;div id="content1"/&gt;
    &lt;div id="content2"/&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am using ajax to dynamically load content1 and content2 from the same file (say Content.aspx).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="content"&gt;
    &lt;input id="content_data" type="hidden" value="whatever"/&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Since the html in content1 and content2 share elements id's, jquery always finds content1 elements:</p>
  
  <p>$("#content_data").val();</p>
  
  <p>If however I use the parent div I can get the data I want:</p>
  
  <p>$("#content1").find("#content_data").val();</p>
  
  <p>The problem:</p>
  
  <p>Given a single Content.aspx page, how can the page (on the client side) know which container div it is is?</p>
  
  <p>On Page_load (server side) I know the page index which I can save in a hidden field on the page but on the client side when I run jquery to get the hidden index I don't know which parent div to look in - unless I'm overlooking something (quite possible) it's a catch-22 situation.</p>
  
  <p>If I can get a hold of an element I can query it's parent and determine which content div it is in, but I can't get that far, because to get an element I need to use jquery and it always finds elements in the first content div. So client side I can't tell where I am from the start.</p>
  
  <p>First of all is this a good way to accomplish what I want, two or more divs loaded with identical pages (but different data) existing in the same document?</p>
  
  <p>An alternative I thought of would be to have multipe content.aspx pages, content1.apsx, content2.aspx, and so on...each identical but with with unique element id's based on its ordinal position.</p>
  
  <p>I feel this would be much 'safer' but would require more maintenance to keep all the pages in sync as things change.</p>
  
  <p>In case you're wondering, the specific use case I'm trying to accomplish is having multiple customer pages open simultaneously in a one-page web application.</p>