Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
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 23-Jan-13 22:35pm
Edited 24-Jan-13 7:25am
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

if ur using VS2010 u can debug it.
or else firebug
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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).
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
Adam R Harris at 24-Jan-13 14:43pm
   
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
 
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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Maciej Los 250
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100