Debugging Javascript file

G

Guest

Is there any way to debug a javascript file that I included in my ASP.net
project. or some reason when I call a javascript function in the file from my
ASP.NET code I get an error message. now if i strip the entire code or the
file and put just an alert the code obviously works. So there is an error
somewhere in the javascript code. i do not know where! is there anyway to
compile the javascript file to see if there are any errors in compilation?

thanks in advance
 
B

bruce barker

if you use firefox, turn on the javascript console, it will list the line
number of the error.

-- bruce (sqlwork.com)

| Is there any way to debug a javascript file that I included in my ASP.net
| project. or some reason when I call a javascript function in the file from
my
| ASP.NET code I get an error message. now if i strip the entire code or the
| file and put just an alert the code obviously works. So there is an error
| somewhere in the javascript code. i do not know where! is there anyway to
| compile the javascript file to see if there are any errors in compilation?
|
| thanks in advance
 
K

Kevin Spencer

Assuming you're using IE to debug, you need to do a couple of things. In the
Tools|Internet Options|Advanced tab, you need to enable script debugging.
This will cause IE to break when an error occurs. You can also add break
points to your JavaScript code, by adding the statement "debugger;" on a
line by itself. The script will break at any of these points.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top