...

View Full Version : Embedded Javascript - Add function to register DOM



raskett
09-05-2011, 06:10 PM
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!



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!

DaveyErwin
09-05-2011, 08:58 PM
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 */
}

raskett
09-05-2011, 11:00 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum