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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:43:19+00:00 2026-06-13T12:43:19+00:00

I have following code its working one IE8, FF and other browser but is

  • 0

I have following code its working one IE8, FF and other browser but is not working for IE7
on checking i found formatIncludes[i] is not working, any idea whats wrong in this with IE7 and any work around

var formatIncludes = valueToSet.replace(/[^\D]/g, '');
    for(var i=formatIncludes.length-1; i >= 0 ; i--){
        if(valueToSet && valueToSet != null && valueToSet.endsWith(formatIncludes[i])){
            valueToSet = valueToSet.substr(0, valueToSet.length - 1);
        }else{
            break;
        }
    }

String.prototype.endsWith = function(suffix) {
    return (this.indexOf(suffix, this.length - suffix.length) != -1);
};

formatIncludes can contain any string value

error on IE7

Message: 'length' is null or not an object
Line: 352
Char: 2
Code: 0
URI: http://localhost:7001/HHSPortal/framework/skeletons/hhsa/js/util.js
  • 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-13T12:43:20+00:00Added an answer on June 13, 2026 at 12:43 pm

    It seems that indexing a string with [i] does not work? And the more consistent/correct solution is to use .charAt(i)

    The reasoning can be found in these:

    string.charAt(x) or string[x]?

    JavaScript cross-browser: Is it safe to treat a string as array?

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

Sidebar

Related Questions

I have the following piece of code its working fine,no issues but i am
I have the following code and it's working (as usual) in everything but IE.
I am working with a third-party COM component (i.e. do not have its code).
I have installed AutoIt on my machine. Its working ok on one machine but
I have an implementation of lazyDataModel following this tutorial http://uaihebert.com/?p=1120 My code its a
I have the following code (Yes I know it's quite long winded, but I
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have the following code that is working (clicking on the link will show
I'm working on the following code: // $data has only one dimension AND at
I have this code and its working awsomely fine if i provide a direct

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.