I'm dumb. This does work if you use the right selector. Based on the
structure of my document, $('#foo dl') would never return anything
since my definition list is a sibling of the header, not a child of.
DOH!

On May 1, 5:45 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> 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#foothen window.location would return
> >http://example.org/index.html#foowhile 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