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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:03:26+00:00 2026-05-30T06:03:26+00:00

I am experiencing some of the weirdest behavior of Javascript. Even though the expression

  • 0

I am experiencing some of the weirdest behavior of Javascript.

Even though the expression in the if statement evaluates to false, my code inside the if block keeps executing.

Here is the code snippet:

if (view.leftCols !== null) {
    var leftCols = view.leftCols.split(',');

    for (var lc = 0; lc < leftCols.length; lc++) {
        var lcv = leftCols[lc].split(':');
        var lcol = lcv[0];

        Array.add(allCols, lcol);

        try {
            var lwidth = lcv[1] - MyWorkGrid.getColWidth(lcol);

            if (lcol === 'Edit') {
                if ($.browser.msie && parseInt($.browser.version) <= 8) {
                    lwidth = 23;
                }
            }

            // this if statement fails.
            if (lwidth > 0) {
                grid.SetWidth(lcol, lwidth);
            }
        } catch (e) {
        }

         grid.MoveCol(lcol, 0, 1, 1);
    }
}

Here is my Firebug screenshot:

Firebug

Any ideas?

  • 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-30T06:03:27+00:00Added an answer on May 30, 2026 at 6:03 am

    Despite the line being highlighted in Firebug, are you sure it’s really being executed? I’ve seen this behavior in Firebug (and early versions of the Chrome debugger) where they would sometimes highlight a line of code as though they’d stepped to it, without that line actually getting executed.

    So I’d insert something unambiguous (like a console.log("lwidth = " + lwidth); into the if statement’s body to see if it really executes. The answer may be that Firebug is just highlighting/showing that line as the current one incorrectly without the code thereon actually being run.

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

Sidebar

Related Questions

I'm experiencing some strange behavior with .bind() and .unbind() in JQuery, even though my
I am experiencing some different javascript behavior when running my site on Kindle Fire
I was experiencing some weird behaviour in some of my javascript code, but only
I'm experiencing some strange behavior for which I can't find any documented knowledge. Here's
I am experiencing some very odd timing behavior from a function I wrote. If
I'm experiencing some problems with breaking my code to reusable parts using templates and
I am working on an Orbited -powered website and I'm experiencing some annoying behavior
I am experiencing some very strange behavior with Blend: Since weeks i am working
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have
I'm experiencing some different behavior after switching from ASP.NET MVC 1.0 to ASP.NET MVC

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.