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 9036855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:06:18+00:00 2026-06-16T09:06:18+00:00

I have found the following code on the internet, when I saw this solution

  • 0

I have found the following code on the internet, when I saw this solution I wondered if this key code is the same for all browsers.

var CalendarFilter = Backbone.View.extend({
      // ...
      events: {
        'click .filter':  'filter',
        'keypress input[type=text]': 'filterOnEnter'
      },
      filterOnEnter: function(e) {
        if (e.keyCode != 13) return;
        this.filter(e);
      },
      filter: function(e) { /* ... */ });
      }
    });

Just a doubt, thanks.

  • 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-16T09:06:19+00:00Added an answer on June 16, 2026 at 9:06 am

    First of all, charCode is not keyCode! charCode follows the ascii set, while keyCode is a particular index of the key.. The different values between the two can be seen here: Keyboard Event Character Values for the Lower ASCII Character Set – O’Reilly Answers

    One major difference between charCode and keyCode is that charCode is deprecated and typically has no value in some browsers [apart from 0] when referenced

    Funnily enough, onkeypress seems to return the character code instead of the keyCode, while onkeyup and onkeydown works as expected, so there may be some issues when detecting keyCode values. You can test this out here JavaScript – Detecting keystrokes
    – Additional reference: keyCode and charCode.

    keyCode, charCode and which is not recommended by w3c, however, there is still legacy support for the keyCode model. Solid cross browser/platform support is done with fixed virtual keyCodes that stay independent of keyboard layout – hence being “virtual”.

    Other Virtual keyCodes – outside of the fixed virtual keyCodes – seems to be consistently implemented across vendors as well: KeyboardEvent – Document Object Model (DOM) | MDN Virtual-Key Codes (Windows)

    jQuery uses it’s own keyCode/charCode event object property: .which, which attempts to unify keyCode and charCode. And favors keyCode values – event.which – jQuery API

    In short, your specific keyCode: “13”, should work with most browsers that support javascript as it is a fixed virtual keycode and is consistent with all browsers and platforms

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

Sidebar

Related Questions

After searching lot on the internet we have found following code to get only
Hello this is may first question and I have found so far the following
I have been following a tutorial on the internet it can be found at
All I have found about this is that there are inconsistencies among different web
I managed to modify sample code I found on the internet to find all
I have the following code: var N = navigator.appName, ua = navigator.userAgent, tem; var
I have the following code in a JSP page: <c:forEach var=widget items=${widgets}> <p><h2>Widget</h2></p> <p>IDType:
I have the following code for checking internet connection wifi/EDGE/GPRS/3G on my application. the
I have found the following piece of code which uses XmlHttpRequest to read JSON
On the MSDN, I have found following: public event EventHandler<MyEventArgs> SampleEvent; public void DemoEvent(string

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.