Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Debugging Javascript file

 
Thread Tools Search this Thread
Old 02-07-2005, 03:31 PM   #1
Default Debugging Javascript file


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


=?Utf-8?B?QW5nZWw=?=
  Reply With Quote
Old 02-07-2005, 03:47 PM   #2
Karl Seguin
 
Posts: n/a
Default Re: Debugging Javascript file

Check out this article:
http://www.code101.com/Code101/Displ...le.aspx?cid=67

A simple way, which might not be sufficient for all cases, is to use FireFox
and type "javascript:" in the address bar, which brings up nice details
about errors (better than IEs). Of course that's assuming ur javascript
works in firefox.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Angel" <> wrote in message
news:11B7EF76-4F82-4801-825F-...
> 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



  Reply With Quote
Old 02-07-2005, 04:11 PM   #3
bruce barker
 
Posts: n/a
Default Re: Debugging Javascript file

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

-- bruce (sqlwork.com)

"Angel" <> wrote in message
news:11B7EF76-4F82-4801-825F-...
| 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


  Reply With Quote
Old 02-07-2005, 04:43 PM   #4
Kevin Spencer
 
Posts: n/a
Default Re: Debugging Javascript file

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.

"Angel" <> wrote in message
news:11B7EF76-4F82-4801-825F-...
> 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



  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump