1

I find myself writing more and more Javascript in Visual Studio and floundering around with stupid errors as the code base gets large due to the lack of static type checking and Intellisense.

e.g.

$("#JobVacanciesApplicationEmail").prop("disabled" = false);

should have been

$("#JobVacanciesApplicationEmail").prop("disabled", false);

but happened because I was chopping and changing with this alternative:

//document.getElementById("JobVacanciesApplicationEmail").disabled = false;

I'm only human and I make mistakes, especially after a long day. I use alert boxes to make sure stuff fires, which narrows the problem.

How can I be as productive in Javascript as I am in C#? Is there stuff built into Visual Studio I can activate? What tools are there to help?

Thanks

nmit026
  • 2,328
  • 19
  • 45

2 Answers2

2

Okay, In your scenario you can easily use Chrome debugger or FireBug as per your browser.

  • In Chrome right click your page, choose inspect or ctrl+shft+I, inspector will get opened. Now click on Sources, choose your page ( on which you are working), here you can see your whole code, go to JavaScript code and mark breakpoints ( as you do in VS). Run as you want, this way you can see the syntax mistakes and errors in JavaScript Code
  • Click on Console, if you want to hit and try JQuery or JavaScript Code
superB
  • 278
  • 1
  • 13
1

Try using a linter like JSLint to help keep track of syntax errors. should be similar to what you're used to with IntelliSense

Pabs123
  • 3,275
  • 11
  • 28
  • 1
    Try http://ludovf.net/reactbook/blog/webpack-jshint.html or https://www.npmjs.com/package/jshint. They are not integrated into Visual Studio, and needs Node. – Rajan Panneer Selvam Jan 06 '16 at 05:58