I know it's possible to use 'document.anchor' to fetch an array of the named anchors on a page...but what I need to do is gather that array from multiple html files.
I've created a menu that used two select boxes. The first contains the letters of the alphabet. When you select a letter the second select box fill with all the subheadings that go under 'a' (eg. asthma, acid etc.);
Right now I have all the subheadings in an array, everything filters and works fine but I had to enter them all manually. Anytime someone else adds additional subheadings I have to update the code. Is it possilbe to load all those anchors from the seperate page dynamically instead of manually imputting them.
Is there a way to use 'document.anchors' where you can specify wich page you with to retrieve the anchors from. Maybe something like 'document["a.html"].anchors'. I tried that and it didn't work but you can see what I'm trying to get at.
Thanks,
Pahikua
Comments
:
: I've created a menu that used two select boxes. The first contains the letters of the alphabet. When you select a letter the second select box fill with all the subheadings that go under 'a' (eg. asthma, acid etc.);
:
: Right now I have all the subheadings in an array, everything filters and works fine but I had to enter them all manually. Anytime someone else adds additional subheadings I have to update the code. Is it possilbe to load all those anchors from the seperate page dynamically instead of manually imputting them.
: Is there a way to use 'document.anchors' where you can specify wich page you with to retrieve the anchors from. Maybe something like 'document["a.html"].anchors'. I tried that and it didn't work but you can see what I'm trying to get at.
:
: Thanks,
:
: Pahikua
:
:
:
Hi there,
It looks like the only problem you have is a DOM problem.
You can access anything on any page that you display, no matter how many frames!
It's just a matter of accessing them correctly.
From what I've read you have a menu that has the two select's. Where are these multiple HTML pages being displayed?
If they aren't being displayed then you can't access them. So the only way to do this is to have an external JS file that has them HARD-CODED (just like you've done) and tell them to modify this one file in future.
Look at it this way. Someone has just added something to your system, they have to add it to the directory structure, etc. Just make it part of the proceedure to update this file as well.
You could use a Database and Perl to dynamically generate the HTML code for you but again, someone has to maintain the DB, so it's just as easy to hard-code it isn't it?
HTH
Bradley q:)