用JavaScript(JScript)写ASP程序(build asp with server-side javascript)的优缺点及经验总结。
“谋划”了很长时间,整理学习了很多代码。只是想到哪儿写到哪儿,不断更新;欢迎有过此类编程经验的同仁们斧正,感激不尽。
优点总结:
1、C风格的语法 {},亲切、陶醉。
2、";"的使用,可以在最终发布时压缩代码。
3、三目运算符 ? : ,当然VBS中也可以摹拟出一个象VB中的IIf(expression, truepart, falsepart)式的函数
4、基于prototype的继承、使其能构造出javascript式的类
5、一维数组操作比VBS强,提供了大量的方法,但是没有二维数组的概念,可以摹拟
6、缺省(optional)参数,这一点非常爽。
7、try {} catch(e){}finally{}错误捕捉要比on error resume next 好很多。
8、学习用JavaScript与asp代码有助于将来学习JSP。
9、
缺点总结(也就是VBS的优点):
1、JavaScript没有二进制的处理方法,这样就缺少了如生成验证码、无组件上传等操作功能,当然可以用COM组件或混用脚本来实现。
2、可以用VB来做VBS的编辑器,非常不错,javascript编辑器目前我见过最强的就是Eclipse + jseclipse插件了。
3、VBS提供了丰富的日期和格式化函数
4、和COM+结合没有VBS好
5、
经验总结
1、ASP并不是一种语言,写ASP的服务器端语言有很多种,默认的是VBScript、还有JavaScript,甚至perl script,phython等
2、这里所说的JavaScript是指标准的W3C标准化了的ECMAScript,其实在服务端无论声明脚本语言是JavaScript还是JScript,系统都会调用JScript引擎来解释脚本,也就是说<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>和<%@LANGUAGE="JSCRIPT" CODEPAGE="65001"%>效果是一样的。
3、JScript除了提供W3C标准化了的对象外,还提供了Enumerator 对象、VBArray 对象来完成JS中遍历(VBS中用for each)集合和从COM组件中返回的VBArray的问题。
4、目前国内的JS(ASP)程序非常少,我拜读过代码的有
www.ccopus.com的COCOON系列作品
SIC的LBS2(Blog)程序
JsWIKI (http://www.nirvanastudio.org/ or http://sourceforge.net/projects/jswiki)
待续......
分享到:
相关推荐
This book is the ideal introduction for JavaScript developers who want to create scalable server side applications using Node.js and Koa.js. The book shows you how Koa can be used to start projects ...
服务器端javascript-with-node-js
If you’re comfortable working with JavaScript, this book provides numerous programming and deployment examples to help you take advantage of server-side development with Node. Table of Contents ...
Check if JavaScript is Enabled from Server-Side Using an User Control。
服务器端在Laravel应用程序中呈现JavaScript 在Laravel中使服务器端渲染的难度降低一些。 < html > < head > < title >My server side rendered app</ title > < script defer src ...
With this practical book, you’ll learn how by combining the ASP.NET MVC server-side language, the Bootstrap front-end framework, and Knockout.js—the JavaScript implementation of the Model-View-...
使用Node.js基本Web服务器示例的服务器实现 基本示例: : 请参阅开发人员控制台面板中的“网络”标签,然后查看Http。 稍微扩展的Web服务器样本 尝试发出Http请求 RESTful API 处理文件 尝试使用Express开发...
Node.js is a server-side JavaScript platform using an event-driven, non-blocking I/O model allowing users to build fast and scalable data-intensive applications running in real time. This book gives ...
[奥莱理] Client-Server Web Apps with JavaScript and Java (E-Book) ☆ 图书概要:☆ As a Java programmer, how can you tackle the disruptive client-server approach to web development? With this ...
一本不错的书 很详细 可以学着写自己的javascript框架 :)
With a growing ecosystem of tools and libraries available, and the flexibility to run on many platforms (web, desktop and mobile), JavaScript is a terrific all-round environment for all data wrangling...
《node即学即用》讲解如何用node 构建可扩展因特网应用,是全面的实用指南,除了详细介绍node 提供的api 外,还用大量篇幅介绍了服务器事件驱动...《node即学即用》适合对javascript 及编程有一定程度了解的读者阅读。
Server-Side ActionScript is Adobe’s name for JavaScript 1.5. Flash Media Server has an embedded Java-Script engine that compiles and executes server-side scripts. This Server-Side ActionScript ...
With this practical book, you'll learn how by combining the ASP.NET MVC server-side language, the Bootstrap front-end framework, and Knockout.js - the JavaScript implementation of the Model-View-...
javascript框架的优缺点 javascript中常见的7大框架的有缺点说明!
Chapter 12 Server-Side JavaScript Client-Side JavaScript Chapter 13 JavaScript in Web Browsers Chapter 14 The Window Object Chapter 15 Scripting Documents Chapter 16 Scripting CSS Chapter 17 Handling...
asp jscript JAVASCRIPT教程
JavaScript与JScript从入门到精通JavaScript与JScript从入门到精通JavaScript与JScript从入门到精通