提出问题提出问题
 

已答复JavaScript - Formatting Preferences?

  • 2009年7月2日 17:15eacousineau 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Is there a way to change the JavaScript source formatting preferences? I'm trying to write a class in javascript using the 'this' style, but the JS formatter is screwing with my delegate code.

    I've looked in Tools > Options > Editors, but haven't found anything related to JavaScript.
    For now I'm just gonna use an external editor.

答案

  • 2009年7月7日 3:26YiChun ChenMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    Hi Eacousineau,

    Thank you for your clarification. Now I can understand it better. :)

    This forum is for the support of Visual Studio installation. Since your issue is related to ASP.NET Web Application, you could post your thread on ASP.NET AJAX forums . This will make answer searching in the forum easier and be beneficial to other community members as well.

    Thank you for your understanding.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

全部回复

  • 2009年7月6日 8:03YiChun ChenMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hi Eacousineau,

    More clarification with you. Which edition of Visual Studio are you using now? What kind of project are you developing now? What do you mean "write a class in javascript using the 'this' style, but the JS formatter is screwing with my delegate code."?

    I have VSTS 2008 on my machine and can find JSCript text editor option via Tools >> Options >> Text Editor >> JScript.

    Thanks
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • 2009年7月6日 13:47eacousineau 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     包含代码
    I'm using Visual C# 2008 in VS 2008 - no other components installed. I'm working in an ASP.NET application, testing some AJAX functionality.
    I checked in the options again but JScript is not listed among the languages under the Text Editor options.

    What do you mean "write a class in javascript using the 'this' style

    Sorry about that - typed it out but forgot to elaborate
    // What I called the 'this' style
    function MyClass()
    {
    	this.value = 12;
    	this.method = function() {
    		console.debug("Test: " + this.value);
    	};
    }
    
    // Prototype style
    function MyClass()
    {
    	this.value = 12;
    }
    MyClass.prototype.method = function() {
    	console.debug("Test: " + this.value);
    };
    
  • 2009年7月7日 3:26YiChun ChenMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    Hi Eacousineau,

    Thank you for your clarification. Now I can understand it better. :)

    This forum is for the support of Visual Studio installation. Since your issue is related to ASP.NET Web Application, you could post your thread on ASP.NET AJAX forums . This will make answer searching in the forum easier and be beneficial to other community members as well.

    Thank you for your understanding.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • 2009年7月16日 13:22Wrighteous 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    I'm having the exact same problem.  I have just installed Visual Studio 2008 and have set the Web Environment.  When I go into Tools > Options > Text Editor there is no option for JScript.  I can see all of the other languages eg. C# C/C++ CSS HTML PL/SQL...  Likewise the Javascript intellisense is not working at all.

    eacousinau, did you have any success?

    YiChun Chen, I was talking with my friend via Windows Live Messenger and he like you has JScript listed as an option under Text Editor.

    Please, anybody...help!