Using JScript.NET to make asp.net Web page Basics Tutorial 3

Source: Internet
Author: User
Here is a complete function, a careful experience.
function Getconditions (strcity:string): String
{
var now:date = new Date ();
Switch (Strcity.touppercase ())
{
Case "LONDON":
if (Now.getmonth () <= 7 | | now.getmonth () >= 9)
{
return "Overcast";
}
Else
{
Return "partly overcast and humid";
}
Break
Case "Seattle":
if (now.getmonth () = = 7 && now.getday () = 4)
{
Return "Torrential rain";
}
Else
{
Return "Rain";
}
Break
Case "LA":
return "smoggy";
Break
Case "PHOENIX":
Return to "Damn hot";
Break
Default
Return "Partly cloudy with a chance of showers";
}
}
With JScript.NET, you can also define the types of other. NET schemas, and you can introduce new data types to JScript.NET by referencing namespaces and derived classes. This makes it possible to overlap in the data types of both. See the following table:
Boolean. NET Framework Boolean/jscript Boolean
Number. NET Framework double/jscript Number
String. NET Framework String/jscript string
Int. NET Framework Int32
Long. NET Framework Int64
Float. NET Framework Single
Double. NET Framework Double
Object. NET Framework Object/jscript Object
Date JScript Date Object
Array JScript Array
function JScript Function Object




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.