Click here to Skip to main content
12,395,871 members (56,287 online)
Rate this:
 
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 21:35pm
Updated 24-Jan-13 6:25am
v4
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 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 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2016
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