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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:42:03+00:00 2026-05-20T18:42:03+00:00

I just spent about four hours tracking down this problem. I know what is

  • 0

I just spent about four hours tracking down this problem. I know what is causing it but don’t know why and the “why” is bugging me.

I have the following .js file:

function funcA() {
}
function funcB() {
    do {
    } while (1 == 1) return 0
}

I also have the following HTML page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title></title>
    <script src="JScript1.js" type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
        new funcA();
    </script>
</body>
</html>

When I load the page in IE9 I get an error that “‘funcA’ is undefined.” I can get rid of the run-time error by do any one of the following:

  • Turning on Compatibility View in IE9
  • Removing the DOCTYPE from the page
  • Adding a semi-colon after the while and before the return in the JavaScript (i.e. while (1 = 1); return 0)

Can anyone help me understand what exactly is going on here?

  • 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-20T18:42:04+00:00Added an answer on May 20, 2026 at 6:42 pm

    Unfortunately, JavaScript does not require you to explicitly put in semi-colons everywhere that there should be one – but it will internally put those in for you. This can often lead to hard to trace bugs and unexpected behavior.

    Among other syntax errors in your code (as others have pointed out), the ; after the while in a do-while is required and when you put in there, things work as you expect them to. When this isn’t done, it’s pretty much impossible for the casual developer to predict how different environments will behave without digging deep into the specs of the language and the JS engine and understanding it all – assuming there are no bugs in the implementation of the JS engine itself. Little things such as whether you have braces ( { and } ) in the same line or not can make a difference.

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

Sidebar

Related Questions

No related questions found

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.