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

  • Home
  • SEARCH
  • 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 6181799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:05:20+00:00 2026-05-24T01:05:20+00:00

I am getting some errors via jslint that I need assistance with: Bad Escapement:

  • 0

I am getting some errors via jslint that I need assistance with:

  1. Bad Escapement:

    replace(‘/[^a-zA-Z0-9ñÑáÁéÉíÍóÓúÚüÜ¡¿\s+{0}]/g’, ”)

  2. Empty block:

    $(‘#myElement’).keydown(function (event) {
    if (allowAlphaNumeric(event)) {
    }
    });

  3. Unexpected use of ‘|’

    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);

Anyone have any ideas how I resolve these?

  • 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-05-24T01:05:21+00:00Added an answer on May 24, 2026 at 1:05 am

    Bad Escapement:

    You’re giving replace a string containing a regular expression literal. You almost certainly want to just make it a regular expression literal:

    replace(/[^a-zA-Z0-9ñÑáÁéÉíÍóÓúÚüÜ¡¿\s+{0}]/g, '')
    

    That’s certainly the case if the replace in question is String#replace, which I’m assuming it is. If it’s something else (it would have been handy to know that) and you really want it to be a string, then just make sure you double up any backslashes within the string — \s is not a valid string escape, it’s a regular expression construct. So you’d want \\s there so that the string ends up containing the \ followed by the s. But again, I think you want the literal (where you wouldn’t do that).

    Empty block:

    Put something in the block:

    $('#myElement').keydown(function (event) { if (allowAlphaNumeric(event)) { } });
    //                                                  here -----------------^
    

    Unexpected use of ‘|’

    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
    

    This one looks fine to me syntactically (logically, see note below), since you really do want the bitwise operator there. Just jslint not understanding your intent.

    But, um, isn’t x | 0 the same as x? Couldn’t you just remove that?

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

Sidebar

Related Questions

I am getting some errors thrown in my code when I open a Windows
I'm deploying a webpart on sharepoint and getting some errors. The webpart consumes data
I'm new in subsonic3, and I'm getting some errors when I try to use
I'm working on a school project and I'm getting some weird errors from Xcode.
So, I'm getting some compile errors on netbeans 6.5 generated web service code for
I'm getting some really wierd linking errors from a class I wrote. I am
I want to log some seemingly random errors I'm getting in a Delphi written
I am getting 'trailing whitespace' errors trying to commit some files in Git. I
I'm looking to run some powershell scripts via automation. Something like: IList errors; Collection<PSObject>
So I have a 3D image that's getting transformed into a space via an

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.