Justin Stockton schrieb:
window.location returns the current URL in the browser's locator.
window.location.hash refers to the specific part of the page that the
URL refers too (the part that follow the #). So if you're visiting
http://example.org/index.html#foo then window.location would return
http://example.org/index.html#foo while window.location.hash returns
only #foo. You'll notice that the hash looks exactly like an ID
selector which I am hoping to use on the following code:

<div id="foo" class="accordionMenu">
<h3>Some Menu Item</h3>
<dl>
....
</dl>
</div>
[repeat for each item in the menu each with a different value for ID]

Now if I am able to use the value of window.location.hash as a
selector then I should get something similar to $('#foo dl').show().
Unfortunately though it appears that the jQuery method ($) only wants
to accept strings and objects.
Ok, looks like some debugging is necessary, because I can't see any obvious flaw here. Have you checked how the concatenated selector looks like? What it actually selects? I use Firebug for that all the time, eg. console.log( $(window.location.hash+' dl') )

--
Jörn Zaefferer

http://bassistance.de

Reply via email to