473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Compiler errors in commented JavaScript code

Hi,

I removed some functionality from an ASP.NET 2 webpage by deleting the input
ior textbox control from the page's code. Then I commented out the JavaScript
function on the same page that referenced the deleted control, so the
commented function looks like this:

/*
function MyFunction()
{
}
*/

I'm puzzled why the compiler gives me an error in a line of code that's
inside the commented function, and references the deleted control. It
complains b/c the control doesn't exist... But the code is commented out! Do
you know why does this happens?

Thanks in advance,

Rick
Mar 29 '08 #1
3 1324

You will probably find that you have missed out a semicolon or brace
somewhere else in the code, this is obviously bogus as an error message in
that respect.
"Richard" <Ri*****@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
Hi,

I removed some functionality from an ASP.NET 2 webpage by deleting the
input
ior textbox control from the page's code. Then I commented out the
JavaScript
function on the same page that referenced the deleted control, so the
commented function looks like this:

/*
function MyFunction()
{
}
*/

I'm puzzled why the compiler gives me an error in a line of code that's
inside the commented function, and references the deleted control. It
complains b/c the control doesn't exist... But the code is commented out!
Do
you know why does this happens?

Thanks in advance,

Rick

Mar 29 '08 #2
But the coloring code of Visual Studio shows the function in commented-out
color, then whatever is inside the function should be dismissed by the
compiler.
Also, if some semicolon or brace was missing from other code, how comes
there was no error or warning before commenting the JS function?
I've seen the ASP.NET JS debugger stepping thru commented-out JS code, and I
wonder why? Have anyone else experimented this?

"Just Me" wrote:
>
You will probably find that you have missed out a semicolon or brace
somewhere else in the code, this is obviously bogus as an error message in
that respect.
"Richard" <Ri*****@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
Hi,

I removed some functionality from an ASP.NET 2 webpage by deleting the
input
ior textbox control from the page's code. Then I commented out the
JavaScript
function on the same page that referenced the deleted control, so the
commented function looks like this:

/*
function MyFunction()
{
}
*/

I'm puzzled why the compiler gives me an error in a line of code that's
inside the commented function, and references the deleted control. It
complains b/c the control doesn't exist... But the code is commented out!
Do
you know why does this happens?

Thanks in advance,

Rick


Mar 29 '08 #3

I tried. I cant set a break point on the commented code, nor can I
replicated your problem. You may have some corruption in the symbols
datatbase. Delete the debug stuff and rebuild it.

"Richard" <Ri*****@discussions.microsoft.comwrote in message
news:17**********************************@microsof t.com...
But the coloring code of Visual Studio shows the function in commented-out
color, then whatever is inside the function should be dismissed by the
compiler.
Also, if some semicolon or brace was missing from other code, how comes
there was no error or warning before commenting the JS function?
I've seen the ASP.NET JS debugger stepping thru commented-out JS code, and
I
wonder why? Have anyone else experimented this?

"Just Me" wrote:
>>
You will probably find that you have missed out a semicolon or brace
somewhere else in the code, this is obviously bogus as an error message
in
that respect.
"Richard" <Ri*****@discussions.microsoft.comwrote in message
news:22**********************************@microso ft.com...
Hi,

I removed some functionality from an ASP.NET 2 webpage by deleting the
input
ior textbox control from the page's code. Then I commented out the
JavaScript
function on the same page that referenced the deleted control, so the
commented function looks like this:

/*
function MyFunction()
{
}
*/

I'm puzzled why the compiler gives me an error in a line of code that's
inside the commented function, and references the deleted control. It
complains b/c the control doesn't exist... But the code is commented
out!
Do
you know why does this happens?

Thanks in advance,

Rick



Mar 29 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Phil Powell | last post by:
<script> <!-- function isValidAlert() { for (var i = 0; i < document.alertForm.length; i++) { with (document.alertForm.elements) { if (.name == "text" || .name == "password" || .name ==...
8
by: Charlie Zender | last post by:
Hi, First, this may be a GCC or Linux-specific problem, I'm not sure. I am unable to compile a large body of code with extremely pedantic compile time checks activate, so that warnings cause...
43
by: Anitha | last post by:
Hi I observed something while coding the other day: if I declare a character array as char s, and try to use it as any other character array..it works perfectly fine most of the times. It...
3
by: cameron | last post by:
I compile my project. No errors. Then I hit my page and I get an Error in Application "/" I change nothing and recompile. Works fine. If I compile twice in a row, still get the error. I...
1
by: R.A.M. | last post by:
Hello, (Sorry for my English, it's not my native language...) Could you explain me simple problem? I have little experience. I commented part of .aspx page and tried to rebuild the project....
3
by: perltcl | last post by:
Hi I'm wondering if this is a problem with my (g++) compiler or with the code. I have to modify some code to make g++ compile, else I get a no matching function error. The commented out line...
6
by: Antoine De Groote | last post by:
Google tells quite some things about it, but none of them are satisfactory. I'm on Windows, and shutil operations (e.g. move, copy) throw Permission denied all the time, for the source files. It...
13
by: murphman | last post by:
I recently decided to do the right thing & write accessor functions for my class member variables instead of having them public and introduced a rather nasty bug. The class below shows the error -...
13
by: Jeremy J Starcher | last post by:
Hullo all. A while back I wrote a BASIC compiler and VM in Javascript as a learning project. As happens too often, my life got too busy to do anything with it. Rather that sit on it any...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.