Hello,

Originally I had this long post describing what I'm doing and where I'm
stuck and yadda yadda yadda. I think what it boils down to is that I
just don't know what the syntax of some of this js means.

I've searched several times in the past for what I consider "advanced"
js but all I seem to find are people who seem to still be living in the
late 90s.

Here's a specific example of something I don't quite understand:

(This comes from ajax_tables.js. I cut out some of the code for
brevity.)

loadFromDataAnchor = function (ev) {
    ignoreEvent(ev);
    var format = this.getAttribute("mochi:dataformat");
    var href = this.href;
    sortableManager.loadFromURL(format, href);
};

SortableManager.prototype = {

    "initialize": function () {
        // just rip all mochi-examples out of the DOM
        ...
        // make a template list
        ...
        // set up the data anchors to do loads
        var anchors = getElementsByTagAndClassName("a", null);
        for (var i = 0; i < anchors.length; i++) {
            var node = anchors[i];
            var format = getAttribute(node, "mochi:dataformat");
            if (format) {
--------->     node.onclick = loadFromDataAnchor;
            }
        }
    },
...
};

Is 'node.onclick = loadFromDataAnchor' adding an onclick event to the
current node?

Then going to the definition of loadFromDataAnchor...

loadFromDataAnchor = function (ev) {

What is 'ev' and where does it come from? At this point I assume it
means "event" but I'm not positive. But even if it does, I'm not sure
how it's being used.

<phew>

Having avoided js like the plague for so many years has put me at a bit
of a disadvantage... but I think once I learn the basics I should be
good to go.

I guess this post is a bit long too. So much for rewrites. :)



Thanks,
Chris.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to