Re: DOM/javascript experienced programmer needed for simple task

From: Date: Tue, 14 Jan 2003 15:25:58 +0000
Subject: Re: DOM/javascript experienced programmer needed for simple task
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12414@lists.php.net to get a copy of this message
the anchors of a page are available through document.anchors, getting the div that the anchor is in is difficult to do reliably. I would name the div's similar to the anchors like this <div id="appleDIV"> <a name="appleANCHOR">Apples</a> </div> <div id="pearDIV"> <a name="pearANCHOR">Pears!</a> </div> then with js, just remove the ANCHOR and add DIV to get the layer name... At 11:50 14/01/2003 +0100, Jan Schneider wrote:
Zitat von Greg Beaver <greg@chiaraquartet.net>: hi, We're using webfx.eae.net's tabpanes for the HTML:frames:phpedit template in phpDocumentor. Currently, if an anchor on an invisible tab is referenced by clicking an a href="doc.html#anchor" tag, the invisible tab will not display. I don't know anything about DOM manipulation and would love it if someone with a bit of knowledge could tell me how to get a list of anchors in a div element cross-browser IE 5.5+ NS 6.0+ DOM-compatible, and from there I'm fine because I can just retrieve the attribute once I've found the anchors. What I can't figure out is how to get the list, or the anchor (and how to tell which div it is in once I've found it). Selecting the tab will be easy, so the only stumbling block is finding which tab the anchor (a name=) is on. getElementsByTagName() is what you are looking for: http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-1938918D It can be called on any object that implements the HTMLElement interface: var myDiv = document.getElementById('myDiv'); var myLinks = myDiv.getElementsByTagname('A'); Jan. -- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#12414) next »