Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Not a digression:
The "escape character" we're going to talk about in the second lesson doesn't seem to be related to our course. That is not the case. The escape character is in the
Writing an efficient ASP script can be a lot of trouble.
Sorry, let's get down to business:
The following is the ASP script for lesson two.
Also remember in the first lesson of Liezi, how we wrote an HTML output all in the same line of code. The escape character allows us to increase
The newline symbol.
Here is the code for our top example in the Client HTML output page:
I hit the next line of ASP script again. Pay attention to the "\ R" that you added at the end.
Response.Write ("\ "Hello world\"
\ r ")
"\ r" is a special tag for line breaks. This is the symbol that makes my output on the HTML page broken into several lines. This should be in large
It is very important to use a program or a large page. I once said, once again I repeat. Believe me: If you don't write
The head and tail of things are not clear, you will not find out what you have in the client output of what bugs.
There is one thing you must pay attention to. Think about how I added "\" behind some quotes. If I remove "\", it will
What happened? Let's try the following line of script.
We will probably get an error code listed below:
does not have an escape character:
What if I don't like the escape character? Do I have to use them?
You will be unable to move without them. Look at the following script:
Response.Write (" ' Hello World '
You can alternately use double quotes and single quotes. In my opinion, this is only a stupid way, but it is really a useful way. Even without that, at least from the perspective of HTML aesthetics, we should use the escape character.
One of the things that makes us use the escape character is not very important because he can allow us to output some special characters.
The most important reason for using escape characters (at least for some complex applications) is for the connection of the database. (We'll have a separate course to tell you about the database later.) ) Compare the following two connection strings.
var connection= "Provider=Microsoft.Jet.OLEDB.4.0; Data source= "+ Server.MapPath (" \\TopLevelVirtualFolder ") +" \\DATABASE\\MYDATABASE.MDB; "
Connection= "Provider=Microsoft.Jet.OLEDB.4.0; Data source= "& Server.MapPath (" \toplevelvirtualfolder ") &" \database\mydatabase.mdb; "
Original author: James Clark translation: Huahua reprint please specify
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.