Jscript .NET但是IE好象不支持,如果在服务器端应用的话,不如直接用C#来的爽快

解决方案 »

  1.   

    JScript .NET, the next generation of the Microsoft JScript language, is designed to be a fast and easy way to access the Microsoft .NET Platform using the language of the Web. The primary role of JScript .NET is construction of Web sites with ASP.NET and customization of applications with Script for the .NET Framework.Many of the new features in JScript .NET are being developed in conjunction with ECMAScript Edition 4. These include typed and typeless variables, full support of class-based objects (with inheritance, function overloading, property accessors, and more), and packages. JScript .NET also has additional features not specified by ECMAScript, such as true compiled code, cross-language support through Common Language Specification (CLS) compliance, and access to the .NET Framework.Several new features in JScript .NET were added to take advantage of the CLS — a set of rules that standardizes such things as data types, how objects are exposed, and how objects interoperate. Any CLS-compliant language can use the classes, objects, and components that you create in JScript .NET. And you, as a JScript developer, can access classes, components, and objects from other CLS-compliant programming languages without considering language-specific differences such as data types. Some of the CLS features that JScript .NET programs use are namespaces, attributes, by-reference parameters, and native arraysFollowing are some of the new features in JScript .NET: Class-based Objects 
    JScript .NET (like JScript) supports inheritance through prototype-based objects. JScript .NET also supports class-based objects by allowing you to declare classes that define data and behavior for objects. Classes created in JScript .NET can be used and extended by any .NET language. Classes can inherit the properties and methods of a base class. There are several attributes you can apply to classes and class members that modify their behavior and visibility. For more information, see Class-based Objects. 
    JScript Data Types 
    In JScript .NET (like JScript), you can write programs without specifying data types for your variables. JScript .NET can also be used as a strongly typed language, in which all variables are bound to a specific data type, or you can use a mix of typed and untyped variables. JScript .NET provides many new data types. You can also use classes and .NET types as data types. For more information, see JScript Data Types. 
    Conditional Compilation 
    Directives control compilation of your JScript .NET program. The @debug directive, for instance, turns the emission of debugging information on or off for a particular part of your script. For more information, see @debug Directive. The @position directive sets the line number for the debugger for the current line. For more information, see @position Directive. Both of these directives are useful if you are writing code that will be incorporated in other scripts. For more information, see Conditional Compilation. 
    JScript Namespaces 
    Namespaces prevent naming conflicts by organizing classes, interfaces, and methods into hierarchies. In JScript .NET, you can define your own namespaces. You can also access any .NET Framework namespace with JScript .NET, including ones you define. The package statement enables packaging of related classes for easy deployment and to avoid naming collisions. For more information, see package Statement. The import statement makes a .NET Framework namespace available to a script so that the script can access the classes and interfaces in the namespace. For more information, see import Statement. 
    JScript Variables and Constants 
    JScript .NET introduces a const statement that defines an identifier that represents a constant value. For more information, see JScript Variables and Constants. 
    Enumerations 
    JScript .NET introduces the enum statement that allows you to construct enumerated data types. With an enumeration, you can specify helpful names for your data type values. For more information, see enum Statement. 
      

  2.   

    thanks.
    不过JScript.net基于.net平台,而不像javascript那样只要有个引擎即可。欢迎大虾们继续参与。
      

  3.   

    是否应该引入所有OO高级特性比如继承、多态?似乎太过罗嗦如果HTC加到标准Javascript中应该很好
      

  4.   

    javascript在对象操作中,允许用户自定义类型,相当于一个有属性和方法的类,并可通过prototype实现继承和扩展同意weidegong的观点,javascript的优越性体现在简洁高效
      

  5.   

    JScript 5.6 即ie6.0自带的引擎就支持继承等oo了。不是。net平台。
      

  6.   

    完全实现oo?
    能不用别扭的方法直接实现实现static,extends,abstract....吗?
    有点新鲜,楼上的,详细讲来,洗耳恭听....
      

  7.   

    barrydiu(巴索),"JScript 5.6 即ie6.0自带的引擎就支持继承等oo了"有这方面资料吗?
      

  8.   

    javascript真的是神奇,方法似乎也是一种属性,不同的是这种属性的值是一个function而已。// Define the constructor and add instance specific information.
    function Circle (radius) {
        this.r = radius;  // The radius of the circle.
    }
    // Add a property the Circle prototype.
    Circle.prototype.pi = Math.PI;
    function ACirclesArea () {
       // The formula for the area of a circle is pi*r^2.
       return this.pi * this.r * this.r; 
    }
    // Add a method the Circle prototype.
    Circle.prototype.area = ACirclesArea;
    // This is how you would invoke the area function on a Circle object.
    var ACircle = new Circle(2);
    var a = ACircle.area();
      

  9.   

    原本以为自己对javascript还了解的挺多,现在一看,原来了解的只是DHTML,唉,学吧
      

  10.   

    同意: weidegong(weidegong) 发挥 HTC 的作用,使的 JS 看起来不会那么的杂乱无章,
    有利于共享和代码升级
      

  11.   

    以前没接触过HTC,有机会倒要看一看。
    runmin(悠悠 稻草人)说的“真的是神奇”,不知道是不是为了弥补js的非OO而引入的,用惯了真正的OO语言倒觉得有一点别扭。欢迎大家继续。尤其是以下问题:
    如果要设计这样一种OO脚本语言,它应该具有什么样的功能(至少JS所能做到的它也应该做到吧)?应该弥补JS的哪些不足(包括功能、使用等方面)?应该在哪些方面与新技术相结合?:)
      

  12.   

    yu_hl(卖柴火的小男孩):你是不是要设计这样一种OO脚本语言啊?:)
      

  13.   

    seabell(百合心),有这种想法,尝试一下 :)
      

  14.   

    把JScript的变量空间用好了。
    那么变化就已经够多了。
    简单例子
    function aa() 

    var v=Math.random(); 
    function bb() 
    {
    return v;

    return bb; 

    var b1=aa(); 
    var b2=aa(); 
    alert(b1==b2); 
    alert(b1()+":"+b2()+":"+b1());
    更复杂的例子?http://lostinet.d2g.com/Lostinet-Publish/JScriptSoapClient
      

  15.   

    哈哈。。最近还想了一中配合JScript.Net的C#实现后期绑定的方法!
    不过代码还在写中。。
      

  16.   

    Javascript本身就是基于对象的吧
      

  17.   

    yu_hl(卖柴火的小男孩):支持,加油吧 :)
      

  18.   

    唉!HTC那末好的东东可惜就是没人用
    MS也不多推广一下
      

  19.   

    大家都用不就成标准了嘛,Schema不就是MS用起来w3c才改了改纳为标准的吗?