is my url hash defined as jquery data?
<p>I am triggering a javascript based on a hash passed in a url.</p>

<p>But if the hash is not one that I am expecting I don't want to trigger.</p>

<p>The list of expected hashes is defined using the <code>data-category</code> attribute.</p>

<p>How could I get an array of this data so I can see if my hash is in the array?</p>

<p>Here is the HTML I am given:</p>

<pre><code>    &lt;div class="filter_padder" id="nav_channels"&gt;
        &lt;div class="filter_wrapper" style="max-width:650px;"&gt;
            &lt;div class="filter selected" data-category="cat-all"&gt;ALL&lt;/div&gt;
            &lt;div class="filter" data-category="MusicWorld"&gt;MusicWorld&lt;/div&gt;
            &lt;div class="filter" data-category="Awards"&gt;Awards&lt;/div&gt;
            &lt;div class="filter" data-category="MX"&gt;Exchange&lt;/div&gt;
            &lt;div class="filter last-child" data-category="Com"&gt;Community&lt;/div&gt;
            &lt;div class="clear"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>Javascript:</p>

<pre><code>// set any hash in the url to a variable
var hash = location.hash.replace('#', '');

// see if my hash is expected (would like to handle this dynamically)
if(hash === (cat_all|Awards|MX|Com)) {
  doSomething();
}
</code></pre>

<p>But I don't know how to dynamically build the list of elements to compare to 'hash'.  I think it's something along the lines of:</p>

<pre><code>$('#nav_channels').data('category');
</code></pre>

<p>But can't get that to work.</p>
