Q:

How do I use bind() properly?

Possible Duplicate:
How do I pass arguments to bound methods 

How do I use bind() in this instance.
I need to bind a function ...but the code below calls it.  How do I use bind().  I read the MDN documentation but it did not make sense.
bind_enter_key and bind_file_upload are methods i wrote.
mdn documentation on bind
m5('signin_pass',bind_enter_key(event,interface_signin)); // this does not work
m5('upload_file',bind_file_upload);

// just a minimzer

function m5(a,b)
  {
  return document.getElementById(a).onkeypress=b;
  }

A:

Wow, you really made this confusing by using bind in two different ways (one in your function name and one in the operation you want to perform on that function).
m5('signin_pass', bind_enter_key.bind(null, event, interface_signin));

Note that you seem to be binding to the current value of window.event by doing this, which is probably a horrible idea. Better might be
m5('signin_pass', function (event) {
    return bind_enter_key(event, interface_signin);
});

