JavaScript ASP Tutorial Lesson three new String () Constructor _asp Foundation

Source: Internet
Author: User
Begin:
The new String () is another strange place that appears earlier in this course plan. However, as with the escape character, the new String () is the necessary element to create a successful ASP JavaScript application. Here are two scripts for this lesson:

The following is the actual weight of the script:

Behavior in the new String ():
Now let's take a look at the ASP line below. The
Request.Form we will have an independent course to teach later. Here's what we're going to focus on now. The data held in Request.Form (data from the user) is not a JavaScript data type. Instead, it is an ASP local data type. JavaScript does not handle ASP data types. The solution is to convert the ASP data types to JavaScript data types. In this example, the method of implementation is to use the new string () constructor.
Shortcut notes:
If you want to request.form text back to the user, you do not need a new string (). But if you want to use a JavaScript function or method to process the text, you must use the new string ().
No new String ():
Look at the line I typed below:
var webpagevariable = Request.Form ("webpagevaraible"). toUpperCase ();
Error! The row above will throw an error because Request.Form ("webpagevaraible") is an ASP object, and toUpperCase () is a JavaScript method.
forward:
Now that we have the escape character and the new string (), everything seems to be much simpler in ASP JavaScript.
you actually only see the tip of the iceberg. We can mix and match JavaScript and VBScript functions and methods. VBScript and JavaScript functions can pass parameters to and from each other. They can be perfectly integrated together. This will be the fourth lesson to be told.

The original and example address of this section: Http://aspjavascript.com/lesson03.asp
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.