Asp JavaScript 教程 - Lesson 01 A General Overview

转载 2006年06月24日 13:03:00
 

A General Overview

Before We Start:

ASP stands for Active Server Pages. ASP comes from Microsoft and it promises a language neutral platform on which to develop dynamic web pages.

Your Scripts are written as plain text and stored in files with the .asp extension. When called upon, your script goes through the ASP script engine, which combines your scripts with information from the web surfer, possibly a database, and other sources as you see appropriate.

Based on the presumptions laid out on the home page, I assume you already know how to create text files with an .asp extension. I also assume you already know how to place your files into a virtual folder. There is a lot of documentation on how to do these things, but the subject matter is beyond the scope of this web site.

Get Started:

The best way to get into this lesson is simply to dive right into the script.

Below is the ASP Script for Lesson 01.

<%@LANGUAGE="JavaScript"%>
<%
Response.Write("<HTML>")
Response.Write("<BODY>")
Response.Write("Hello World<BR>")
Response.Write("</BODY>")
Response.Write("</HTML>")
%>

Click Here to run the script in a new window.

Tags:

This is a pretty simple example. My bet is that you already get it. Have you noticed that ASP tags are similar to HTML tags? There is a difference. <%ASP Goes Here.%> The ASP tags use a percent sign.

@LANGUAGE:

The @LANGUAGE attribute is set to "JavaScript". That means ASP will run our scripts through the JavaScript (JScript) script engine.

Most servers are set by default to use VBScript. We can change the default language for a single page by using the @LANGUAGE attribute. @LANGUAGE must be set BEFORE any other ASP commands. So, it's a good idea to put @LANGUAGE right at the very top, even before your HTML headers. @LANGUAGE can only be set ONCE in any particular script. It should also stand alone; don't put any other command inside the same set of tags.

Misc. Notes:

Response is an ASP object (Not to be confused with JavaScript objects) and Write is an ASP method (not to be confused with JavaScript methods). Response gets its own lesson later on.

The last thing we need to notice on this script is the difference between the ASP script and the resulting HTML Script.

Below is the HTML source code as seen on the client side.

<HTML><BODY>Hello World<BR></BODY></HTML>

The Client Side output is all on one line. If you haven't already, click the link to run the script and then View Source Code. You will see that the entire HTML text is one unbroken line. That's bad. On lager pages, it will make the HTML output difficult to read. Trust me; you can't find bugs if you can't even make heads or tails of what you're putting out to the client.

In Lesson 02 we will fix that problem.

相关文章推荐

C++ SDL教程翻译 Lesson 01 Hello SDL

好吧,这就是SDL翻译系列的第一篇,我会在每一篇翻译末尾适当添加些内容,方便你的理解。注:我才14,初二,可能翻译的并不好,纯手工加翻书,勿喷,有建议可回复或联系QQ540809998。...

[基于ionic开发]开发教程lesson01之环境安装

1.准备工作     下载 Node.js(下载包),WebStorm(IDE,编写代码,浏览器调试),JDK(webstorm 运行环境),Android SDK (Android编译)     ...

NeHe教程Qt实现——lesson01

NeHe 系列教程之一: 创建一个OpenGL 窗口 英文教程地址: lesson01 在Qt的实现中, 我们主要依赖QGLWidget类, 我们主要重载三个重要方法 :     voi...

The world of LTE _General_overview_map

  • 2016年06月30日 06:24
  • 1.18MB
  • 下载

ASP。NET中的JAVASCRIPT 01

  • 2009年06月19日 12:25
  • 500KB
  • 下载

01 JavaScript基础教程

1. JavaScript基础1.1 JavaScript介绍 JavaScript 是互联网上最流行额脚本语言;JavaScript一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,...
  • hxdeng
  • hxdeng
  • 2016年08月17日 10:25
  • 223

NeHe Lesson01

  • 2007年10月07日 23:14
  • 1.43MB
  • 下载

Spark1.6.0官方文档翻译01--Spark Overview

spark1.6.0官方文档阅读笔记,部分重要内容的翻译。此文档作为自己阅读时候的笔记使用。如有错误,请留言指出。希望大家能够一起学习Spark。...

Lesson01:课程概述与如何学好FPGA

  • 2011年06月30日 20:16
  • 46.05MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Asp JavaScript 教程 - Lesson 01 A General Overview
举报原因:
原因补充:

(最多只允许输入30个字)