javascript¼Ì³Ð·½Ê½Ö®Èý
3¡¢×éºÏ¹¹Ô캯Êý/ÔÐÍ·½Ê½Ð´À࣬²ÉÓÃÇ°ÃæÖÖ·½Ê½¼Ì³Ð
ÕâÖÖ·½Ê½¸¸À࣬×ÓÀàµÄÊôÐÔ¶¼¹ÒÔÚ¹¹Ô캯ÊýÀ·½·¨¶¼¹ÒÔÚÔÐÍÉÏ¡£
/**
* ¸¸ÀàPolygon:¶à±ßÐÎ
*/
function Polygon(sides) {
this.sides = sides;
}
Polygon.prototype.setSides = function(s) {this.sides=s;}
/**
* Triangle Èý½ÇÐÎ
* @param {Object} base µ×
* @param {Object} height ¸ß
*/
function Triangle(base,height) {
Polygon.call(this,3);//¸´ÖƸ¸ÀàÊôÐÔ¸ø×Ô¼º
this.base = base;
this.height = height;
}
Triangle.prototype = new Polygon();//¸´ÖƸ¸Àà·½·¨¸ø×Ô¼º
Triangle.prototype.getArea = function(){ //×îºó¶¨Òå×Ô¼ºµÄ·½·¨
return this.base*this.height/2;
}
//new¸ö¶ÔÏó
var tri = new Triangle(12,4);
console.log(tri.sides);//¼Ì³ÐµÄÊôÐÔ
console.log(tri.setSides);//¼Ì³ÐµÄ·½·¨
console.log(tri.base);//×ÔÓÐÊôÐÔ
console.log(tri.height);//×ÔÓÐÊôÐÔ
console.log(tri.getArea);//×ÔÓз½·¨
//instanceof²âÊÔ£¬±íÃ÷ÕýÈ·µÄά»¤ÁË"is a"µÄ¹Øϵ
console.log(tri instanceof Triangle);//true£¬±íÃ÷¸Ã¶ÔÏóÊÇÈý½ÇÐÎ
console.log(tri instanceof Polygon);//true£¬±íÃ÷Èý½ÇÐÎÒ²ÊǶà±ßÐÎ
àÅ¡£°´ÕÕÕâÖÖģʽдjs£¬Ò²Äܹ¹½¨Ò»Ð©´óÐÍÄ£¿é¡£
Ïà¹ØÎĵµ£º
Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......
C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ ......
ÃæÏò¶ÔÏóµÄÓïÑÔ¶àÊý¶¼Ö§³Ö¼Ì³Ð£¬¼Ì³Ð×îÖØÒªµÄÓŵã¾ÍÊÇ´úÂ븴Ó㬴Ӷø¹¹½¨´óÐÍÈí¼þϵͳ¡£Èç¹ûÒ»¸öÀàÄܹ»ÖØÓÃÁíÒ»¸öÀàµÄÊôÐԺͻò·½·¨£¬¾Í³Æ֮Ϊ¼Ì³Ð¡£
´ÓÕâ¸ö½Ç¶ÈÀ´¿´¿´jsµÄ¼Ì³Ð·½Ê½¡£jsÖм̳з½Ê½ÓëдÀ෽ʽϢϢÏà¹Ø¡£²»Í¬µÄдÀ෽ʽÔì³É²»Í¬µÄ¼Ì³Ð·½Ê½¡£¸÷ÖÖÁ÷ÐÐjs¿â¼Ì³Ð·½Ê½Ò²¸÷²»Ïàͬ¡£´Ó×î¼òµ¥µÄ
¸´ÓÿªÊ¼¡£
1¡¢¹¹Ôìº ......