Returning true and false isn't applicable to this kind of connect, that only works for events stuck directly to DOM elements (as in HTML). What you want is to use e.preventDefault() as Beau said earlier in the thread.
-bob On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > Ok, this is now working (sort of), and I think I kinda get it. > > How do I tell this "connect" to return true of false for the onkeydown > event? I want to disable some keys in a field. Is this possible? > > On Apr 15, 10:24 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > This time it's for a different reason, you're running connect before > > the 'orig_directory' element exists. If you look at any of the > > MochiKit examples you'll see that they all use addLoadEvent or > > something equivalent to deal with DOM initialization. The alternative > > is just to put the script tag at the bottom of the body. > > > > -bob > > > > On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm sorry if I'm maybe not figuring this out, but I've cut it down to > > > the simplest of tests, and still can't get past the src error: > > > > > src has no properties > > >http://brain.solepixel.com/js/lib/MochiKit/packed/MochiKit.js > > > Line 4265 > > > > > This time I'm not even loading anything through ajax. > > > > > On Apr 15, 9:56 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > > > That error is because you're trying to connect to something that > > > > doesn't exist in the document. There is no element with the id > > > > 'directory'. > > > > > > Also, you shouldn't use $('directory'), just use 'directory'. connect > > > > takes care of looking it up. > > > > > > There's a "packed" folder in all releases of MochiKit which contains > > > > the packed version of MochiKit. It's a packed single-file distribution > > > > for production use. > > > > > > -bob > > > > > > On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > > > > > > Ok, I moved MochiKit to the top of the loading list, and i get a > > > > > different error now: > > > > > > > src has no properties > > > > >http://brain.solepixel.com/js/lib/MochiKit/Signal.js > > > > > Line 522 > > > > > > > Also, I don't quite know what "loading the packed version of MochiKit" > > > > > means. Is this a separate download or a different way to reference the > > > > > js source? > > > > > > > On Apr 15, 9:37 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > > > > > Looks like you might have some kind of conflict with the debug > > > > > > version > > > > > > of MochiKit and scriptaculous or prototype. Load the packed version > > > > > > of > > > > > > MochiKit, and/or load MochiKit first. You're going to want to use > > > > > > the > > > > > > packed version at some point anyway, the debug version loads several > > > > > > unpacked files via document.write, which is slow. > > > > > > > > -bob > > > > > > > > On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > > > > > > > > I have setup a very simple test including both Scriptaculous and > > > > > > > Mochikit, and I'm getting the same results as my application: > > > > > > > > >http://brain.solepixel.com/mochitest.html > > > > > > > > > Please help. This is frustrating. > > > > > > > > > On Apr 15, 8:54 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > > > > > > > What you should do at this point is post a *complete* example > > > > > > > > of what > > > > > > > > you're doing. You've missed something somewhere and it's not > > > > > > > > reflected > > > > > > > > in the questions you're asking or the code you've posted so > > > > > > > > far. If > > > > > > > > you're getting "MochiKit.Signal has no properties" then MochiKit > > > > > > > > probably isn't loaded at all, so your problem is probably in > > > > > > > > the HTML > > > > > > > > somewhere. > > > > > > > > > > -bob > > > > > > > > > > On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > I'm sorry, i should've changed that before I posted it. I > > > > > > > > > have indeed > > > > > > > > > tried MochiKit.Signal.connect as well as just connect. The > > > > > > > > > Mochikit.connect (although Mochikit should've been MochiKit) > > > > > > > > > was just > > > > > > > > > a last resort effort. > > > > > > > > > > > I get error: > > > > > > > > > > > Error: MochiKit.Signal has no properties > > > > > > > > > > > Would scriptaculous, or a pngbehavior or something else > > > > > > > > > possibly be > > > > > > > > > conflicting with MochiKit? Is there an "onload" function I > > > > > > > > > should know > > > > > > > > > about? Is there a simple Hello World I can test to see if > > > > > > > > > I'm doing > > > > > > > > > it right? > > > > > > > > > > > On Apr 15, 8:25 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote: > > > > > > > > > > On 4/15/07, briandichiara <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > Ok. So i have moved my stuff to my Success function, but > > > > > > > > > > > I still get > > > > > > > > > > > the connect error. > > > > > > > > > > > > > According to the example, all I really need to do this is: > > > > > > > > > > > > > <script type="text/javascript" > > > > > > > > > > > src="js/lib/MochiKit/MochiKit.js"></ > > > > > > > > > > > script> > > > > > > > > > > > > > right? > > > > > > > > > > > > > This is the rest of my ajax function: > > > > > > > > > > > > > var params = 'param=params'; > > > > > > > > > > > var url = 'myurl.php'; > > > > > > > > > > > var actions = Mochikit.connect($('directory'), > > > > > > > > > > > 'onkeydown', > > > > > > > > > > > > It's not Mochikit.connect. It's not even MochiKit.connect. > > > > > > > > > > It's either > > > > > > > > > > MochiKit.Signal.connect or just connect. > > > > > > > > > > > > -bob > > > > > --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
