using the window object for accessing global user defined objects and using text within html for creating additional specificity
<p>I don't do very much jquery / javascript but wanted to ask for some advice on the following piece. I have tried to cut out as much as possible. Most of this was semi-inherited code with catching a bunch of events just hardcoded in. I'd like to generalized them more by putting the object name in the html and accessing via jquery on processing (by_date, by_popularity). I retriev as string and access the object via window[current_obj]. Is this a good way to do this or am I missing something? Are there preferable ways to introduce specificity. thanks for any advice.</p>

<pre><code>&lt;script&gt;
var by_date={};
by_date.current_page=1;
by_date.per_page=4;

var by_popularity={};
by_popularity.current_page=1;
by_popularity.per_page=4;

$(function(){
    $('.previous.active').live('click',function(){
        window[current_obj].current_page--;
        process(window[current_obj]);
    });
});

function process(game_obj){
   //will process and output new items here
}
&lt;/script&gt;

&lt;div class="otherContainer"&gt;
  &lt;a class='previous active'&gt;Prev&lt;/a&gt;&lt;div style="display:none;"&gt;by_date&lt;/div&gt; | &lt;a class='next'&gt;Next&lt;/a&gt;&lt;div style="display:none;"&gt;by_date&lt;/div&gt;
&lt;/div&gt;


&lt;div class="topPrevNextContainer"&gt;
  &lt;a class='previous active'&gt;Prev&lt;/a&gt;&lt;div style="display:none;"&gt;by_popularity&lt;/div&gt; | &lt;a class='next'&gt;Next&lt;/a&gt;&lt;div style="display:none;"&gt;by_popularity&lt;/div&gt;
&lt;/div&gt;
</code></pre>
