Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7913379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:49:44+00:00 2026-06-03T13:49:44+00:00

So say I have this .. keyup_handler: function(e, item){ if (e.which == 27) {

  • 0

So say I have this ..

  keyup_handler: function(e, item){
    if (e.which == 27) {
      close_lightbox(item);
      return false;       
    };
  }

$(document).live('keyup', function(e){ keyup_handler(e, item) });

This is not returning any console.log()’s I place in here. So I assume that that it’s not being touched. What am I missing? How do I pass the e or event to keyup_handler?

jQuery 1.4.4

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:49:46+00:00Added an answer on June 3, 2026 at 1:49 pm

    You’re returning false from the call to keyup_handler, but not from the function that calls it, try doing:

    $(document).live('keyup', function(e){ return keyup_handler(e, item); });
    

    You may also need to modify keyup_handler slightly to return true; if the if statement doesn’t evaluate to true.

    I’m assuming here that your very vague “doesn’t work” statement means that the usual keyup functionality isn’t prevented when you release the corresponding key.

    Also, .live() is a deprecated jQuery function, and isn’t really intended for what you’re using it for. Use .on() (if you’re using jQuery 1.7+) or .bind() otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, so let's say I have this: $(function() { $('#good_evening').keyup(function () { switch($(this).val()) {
say I have this on my routes.rb: resources :accounts which gives me, among other
Say I have this code: function onComplete(event, request, settings) { // How do I
Say i have this short code: item = Item.find(params[:id]) render :json => item.to_json but
Say I have this class: class A { private $var_a, $var_b; public function do_something(){
Say I have this example: char const * const foo( ){ /* which is
Say I have this small function in a source file static void foo() {}
I have this function which removes selected (cursor) highlighted elements: function deleteSelection() { if
Say I have this html: <table> <tr> <th>Sort Order</th> <th>Name</th> </tr> <tr class=item id=item_1>
Say I have this query: SELECT name::text, id::int, pass:bool FROM mytable; which gives me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.