Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Various XML DOM Questions

    I have a couple questions and more will probably be added later. I'm working on a project where a wishlist is created from an xml file. The following are the files that make up the list.

    xhtml: [http://null.ithium.net/andrew/NewGen...wishlist2.html]
    css: [http://null.ithium.net/andrew/NewGen.../wishlist2.css]
    js: [http://null.ithium.net/andrew/NewGen...ee/menuTree.js]
    xml: [http://null.ithium.net/andrew/NewGen.../wishlist2.xml]
    xmlLoader: [http://null.ithium.net/andrew/NewGen...xmlLoader.html]

    The first question, is how to properly add the events to the links where the list item contains children.
    PHP Code:
    <a href="#" class="parent" onclick="door(this); return false">Wishlist</a
    The two options that I saw, were either adding the onclick as an attribute, or using the addEventListener method. I'm guessing that the former might not work, and do not know how to use the latter.

    Edit: I just read on Mozilla's DOM Reference that you can use element.onclick, maybe that is the way to go.


    My next question, is how to add the text within the <a> and </a>.

    -----=-----=-----=-----
    There are a zealous few out there that would like nothing better than to do this for me. Please refrain from doing so, so that I can see what I can accomplish myself.
    -----=-----=-----=-----
    Last edited by Antoniohawk; 07-08-2004 at 04:05 AM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'm gonna start working on this again, so this thread needs a bump.

  • #3
    Regular Coder
    Join Date
    Jun 2004
    Location
    underground
    Posts
    186
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So, which question are you bumping, and who are the "zealous few"? (A rather pretentious statement, it seems.)
    Modesty is often lacking in our transactions.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Any question that someone can answer is a big help to me. If you feel that being zealous is a bad thing then I'm sorry that you do so.

  • #5
    Regular Coder
    Join Date
    Jun 2004
    Location
    underground
    Posts
    186
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I don't feel that way, necessarily; besides, my point was that it seemed pretentious to state that others had nothing better to do than solve your problems.

    Asking about which question you were calling attention to was my attempt to hint that you might do a bit more than link to various source code to define your problems; something along the lines of providing a test that isn't quite working, for example, might get more responses (based on the fact that very few well-presented questions go unanswered around here).

    Good luck.
    Modesty is often lacking in our transactions.

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I know that a lot of people out there don't have the time to do it for me, but there are some people on this board that have done just that before. I guess that the question that I most want answered is the one about assigning events to an element that I create via my xml. I could test a bunch of methods that I don't really know how to use and then have some work, but I'm more interested in the correct method to use and how to use it. I have figured out how to get the value of the <a> elements by using element.firstChild.nodeValue, so that is no longer a problem. Thanks for any help that can be provided.

  • #7
    Regular Coder
    Join Date
    Jun 2004
    Location
    underground
    Posts
    186
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a browser/event comparison table, which may help you determine what's best: http://www.quirksmode.org/dom/w3c_events.html
    As for how to use methods conditionally, I guess it depends...
    Last edited by neofibril; 08-19-2004 at 05:25 AM. Reason: sp
    Modesty is often lacking in our transactions.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •