compilation and debugging of Jscript???

Posted by Asokmailworld under ASP.NET on 6/18/2012 | Points: 10 | Views : 1045 | Status : [Member] | Replies : 7
Hi Gd evng dear frnds,


This time, i wan to know about java script compilation in Visual Studio.net 2008,
we are writing jscript in side of <script> and </script> tags. My question is that, if i debug my web application , i can view control flow of compiler if i put break point. Similarly how can i view the java script debugging . Inside of <script></script> tags, i can't able to put the break point.So please i request you to give some information about it. I will be great thankful to you guys. i really means the compilation and debugging of Jscripts.

Thanks and regards
asok kumar




Responses

Posted by: Girinarra on: 6/18/2012 [Member] Starter | Points: 25

Up
0
Down
You can use the alert or debugger;
Please go thourgh the below examples

<script>
function test(){

alert(PageMethods.MyMethod("Test"));
}
</script>

<script>
function test()
{
Debugger;
}
</script>


Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhiram on: 6/18/2012 [Member] Starter | Points: 25

Up
0
Down
Follow these steps to Debug JavaScript Code

1. Browser Tools -> Internet Options.-> Advanced
2. Uncheck - Disable Script Debugging (Internet Explorer) -> OK
3. Close the browser and start a new instance.
4. In javascript code, to start debugging write the statement: "debugger;"
5. Open the page the in brower
6. When the statement "debugger" is executed, browser shows a dialog for selecting the debugger...
7. Select the already exiting Visual Studio Instance --> OK
8. Continue Debugging using Debug toolbar (right click on menubar and select debug)

Hope this will help you.


Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
Put
debugger;
in your JavaScript Code when you want debug code;

Use IE as Default browser in Visual Studio,
it is best for JavaScript Debugging.

and also useful to find bugs because if IE display perfect content r=then it will also perfect for other browser.

Ajay
ajaypatelfromsanthal.blogspot.in

Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/4/2012 [Member] Starter | Points: 25

Up
0
Down
IE browser
--------------------
Uncheck - Disable Script Debugging (Internet Explorer)
<script>
function debug()
{
Debugger;
}
</script>

try this.................




Regards
Muralidoss M

Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhagwati on: 7/5/2012 [Member] Starter | Points: 25

Up
0
Down
You can debug your javascript code in browser in IE press f12 and then click script and put break point.
it will debug same as dot net debugger.

Bhagwati pal

Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 7/5/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
In Visual Studio 2012 you can debug the javascript and also in 2010 i used to do just cant remember what i did. but for faster solution as the other guys suggested you can use alerts

Thank you for posting at Dotnetfunda
[Administrator]

Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

For Visual Studio
you can put
Debugger;
Like

<script>Debugger;</script>

OR you can also use Firebug and its inbuilt JavaScript Debugger and in that you can also put break point

Thanks



R D Patel

Asokmailworld, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response