使用JScript.NET创建asp.net页面(三)

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
下面给出一个完成的函数,仔细的体会一下。
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 "damn hot";
break;
default:
return "partly cloudy with a chance of showers";
}
}
使用Jscript.net,你也可以定义其他.net架构的类型,通过引用命名空间和派生类可以向Jscript.net引入新的数据类型。这样在两者的数据类型中就有可能产生重叠。参见下表:
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

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: javascript
想对作者说点什么? 我来说一句

使用JScript.NET创建asp.net页面

zgqtxwd zgqtxwd

2008-04-24 08:11:00

阅读数:94

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭