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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unhappy Embedded Javascript - Add function to register DOM

    Hi all,

    I am rather stuck with the following code and am finding it tough to find resources to help me. I am new to DOM functions and any explanation would be much appreciated!

    Code:
    var DATE =
    
    {date:
             xxx, layers:
    {top:
             'topLayer'
},
ids: [xxx], go: function() {}
    };

    I also need to add a function to the variable 'DATE' so that it can register DOM events, then modify 'DATE' so that it adds another name-value pair to layers on page.

    I have been trying to working this out for 24 hours now and am very confused. Any support would be awesome!

    Thank you!
    Last edited by raskett; 09-06-2011 at 12:24 AM. Reason: Major errors in original...

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    967
    Thanks
    19
    Thanked 211 Times in 209 Posts
    YAD is just a "hast"
    an array of name value pairs
    if you want something to happen
    when you do YAD.go() just add
    the code to the function here ...

    go: function() {
    /* code goes here */
    }

  • Users who have thanked DaveyErwin for this post:

    raskett (09-05-2011)

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you for the feedback! I really appreciate it.

    I have been reading up on the 'go: function' although am still quite confused in regards to the following:

    -Adding a function to YAD so it can register DOM events

    Could you possibly elaborate on this? I understand the code needs to be placed within the function call although I am not quite sure how to register the dom events.

    Where would they be stored and how would I ensure the function stores them?

    Thanks again.


  •  

    Posting Permissions

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