Bob Ippolito wrote:
> Yes, but you probably ought to be using MochiKit.Signal's connect
> function for that instead...
Hi Bob.
I'm attempting to learn to use MochiKit.Signal and I'm stuck. The
documentation for connect() says "src is the object that has the
signal. You may pass in a string, in which case, it is interpreted as
an id for an HTML element." According to that I *think* I'm assigning
an onclick event to the div called 'test' that, when triggered, will
execute the function called writelog(). But I get an error that says
"src has no properties".
Here is my HTML file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<script type="text/javascript"
src="../mochi131/lib/MochiKit/MochiKit.js"></script>
</head>
<body>
<script>
function writelog()
{
log('hello');
}
logError('helllllo');
connect('test', 'onclick', writelog);
void(createLoggingPane(true));
</script>
<div id="test">
<p>
Hi!
</p>
</div>
</body>
</html>
(Now for some questions.)
1. What does MochiKit consider to be a "property"?
2. Does including MochiKit.js automatically include all the libraries
in MochiKit? Is it more efficient to only include the libraries I need
per page?
3. Is there a FAQ somewhere?
4. Why don't I need to access the functions with
MochiKit.Signal.connect()? What if I create my own function later that
overlaps a MochiKit function I am not aware of?
Thanks!
Chris.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---