How to debug the Javascript code

Apr 5, 2013 at 8:55 AM
I am new to this area and maybe I am asking you a stupid question, but could anyone tell me how to debug the Javascript code of the Mileage Stats?

I opened the application with IE10, and opened the debug tool with F12. Then I clicked the View Sources button. I see there jquery...js files and modernizr...js file, but no mstats....js files.
I would like to set a breakpoint in a js file and to watch how the javascript code works, but how can I do it?

Atsushi
Developer
Apr 9, 2013 at 5:24 PM
Hi Atsushi,

In the Dashboard page, when using the developer tools in Internet Explorer 10, you can find the scripts in the View Sources button of the Script tab, named as mileagestats.js and mstats.xxxxx.js . There, I believe you can chose the file you want to debug and insert a breakpoint in it.



Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini
Apr 10, 2013 at 9:54 AM
Hi Damian,

Thank you really very much for your suggestion, but strangely I see no .js files under the debug folder in the list.
In the View Sources I only see the scripts mentioned at the end of the body tag, which are:
    <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
    <script src="//cachedcommons.org/cache/jquery-bbq/1.2.1/javascripts/jquery-bbq-min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js"></script>
    <script src="//ajax.cdnjs.com/ajax/libs/modernizr/1.7/modernizr-1.7.min.js"></script>
Might something be wrong in my configuration?

Atsushi
Apr 10, 2013 at 2:21 PM
I was running the application with MVC 4, without MVC 3. I installed MVC 3 and reinstalled Mileage Stats. It works now, although I do not know why. I see all the .js files under the Debug folder.