Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I written a javascript in a string variable. and this string variable is assigned to a button as
button1.Attributes.add(stringVariable);
now how to debug my string varibale(javascript) in runtime

thanks
chiranjeevi
Posted
Updated 24-Jan-13 6:25am
v4

FYI, javascript doesn't compile so you can't debug it.
However you can use a tool to get value at a certain point like Firebug[^] and also debug it(as you wished).
 
Share this answer
 
if ur using VS2010 u can debug it.
or else firebug
 
Share this answer
 
you can't debug javascript in Visual Studio..but you can debug your javascript in browser using FireBug in mozilla

or check this thread

http://msdn.microsoft.com/en-us/ie/dd699458.aspx[^]
 
Share this answer
 
Comments
Adam R Harris 24-Jan-13 14:43pm    
Visual studio can debug Javascript. You will have to write debugger; where you want to put the debugger. This will open the runtime file in VS. then you can use the IDE to put the breakpoints anywhere. Highlight the variable and see the values in quick watch and everything. else Firebug. Firebug has some learning curve if you are new. you will get used to VS more quickly.

JavaScript
function Test()
{
    var a = 10;
    var b=20;
     debugger;
      alert(a+b);
}


Also remember JavaScript debugging should not be disabled in IE (if doing it in IE). Go to advanced options in IE tools menu and uncheck the checkboxes for Javascript debugging disabled.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900