Using JavaScript to write ASP application--First lesson--_asp Foundation

Source: Internet
Author: User
Tags html tags
The first lesson--a browse
Overview
Before the start: (We should know)
ASP represents the active Server pages.asp from Microsoft, which provides a neutral language platform for developing dynamic Web pages.
Your script is written in plain text, and then saved with an. asp extension. When these scripts are invoked, they first pass the ASP script translation engine, which is used to combine your scripts with those from browsers, or databases, or other sources that you think are appropriate. Based on the assumptions listed on my homepage, I assert that you already know how to create a. The text document at the end of ASP. I can also conclude that you already know how to put your documents into a virtual directory. There are already a lot of documents that can tell you how to do the above, and it's beyond the scope of the site to discuss these issues.
Start the business:
The best way to get into the content of this lesson right now is to dive directly into the script below.
The following is the ASP script for this lesson:
<% @LANGUAGE = "JavaScript"%>
<%
Response.Write ("<HTML>")
Response.Write ("<BODY>")
Response.Write ("Hello world<br>")
Response.Write ("</BODY>")
Response.Write ("</HTML>")
%>
About Tags:
This is a very simple example. I bet you've understood it. Can't you see that tags and HTML tags look alike? In fact, there is no difference between them. <%asp from here to start%>. ASP tags are marked with a "%".
About @language:
The @LANGUAGE is set to "JavaScript." This means that the ASP will interpret the script through the JavaScript scripting engine.
Most servers have VBScript set to the default scripting language. We can change a single page default scripting language by using the @language property. The @language must be set before other ASP directives. So it would be a good idea to put @language in the script, even the top of the HMTL. In any script, @LANGUAGE can only be set once. It must be independent, and do not put it in the same label as other commands.
Other matters to be noted:
Response is an ASP object (please do not confuse it with JavaScript objects), and write is an ASP method (please do not confuse it with the JavaScript method). Response we will have a separate chapter to explain.
The last thing we should note is the difference between the ASP script and the HTML page.
Here is what we see on the client side of the source code.

The client has all the output on it. If you have not seen it, then click on the link to run the above script, and then look at the output of the page after the source code. You will be back to machete the entire HTML text is a complete line. Of course that's bad. In a large page, it will be hard to read the output of HTML. Please believe me: If you don't even have the header of the content you want to output on the client
Or the tail is not clear, you will not find (code) there are any bugs.
In the second lesson, we will solve this problem.
Original and example address of this section: http://aspjavascript.com/lesson01.asp
Chinese version address: http://huahuablog.blogspot.com
Original Author: James Clark translation: Huahua reprint Please specify
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.