JavaScript¼Ì³ÐµÄÎÊÌâ
СµÜ×î½üÔÚѧϰJavaScriptȨÍþÖ¸ÄÏÄDZ¾Ê飬¿´µ½¼Ì³ÐÄÇÀï¿´²»¶®ÁË
JScript code:
//
function Rectangle(w,h){
this.width = w;
this.height = h;
}
//
Rectangle.prototype.area = function(){
return this.width*this.height;
}
//
function PositionedRectangle(x,y,w,h){
//
Rectangle.call(this,w,h);
this.x = x;
this.y = y;
}
//
PositionedRectangle.prototype = new Rectangle();
//
delete PositionedRectangle.prototype.width;
delete PositionedRectangle.prototype.height;
//
PositionedRectangle.prototype.constructor = PositionedRectangle;
//
PositionedRectangle.prototype.contains = function(x,y){
return (x > this.x && x < this.x + this.width && y > this.y && y < this.y + this.height);
}
//²âÊÔ
var r = new PositionedRectangle(2,2,2,2);
alert(r.area());
СµÜÔÀ´Ò²¿´¹ýJavaScript¸ß¼¶³ÌÐòÉè¼Æ£¬Ò²Ã»¼û¹ýÕâôдµÄ¡£ÄǸödeleteÄÇÀïÓÐЩ²»½â£¬ÎÒ°ÑdeleteÆÁ±ÎÁË£¬»¹Êǵò»µ½r.widthµÄÖµÂï¡£»¹ÓÐÄǸöPositionedRectangle.prototype.constructor = PositionedRectangleÒ²ºÜ²»Àí½â¡£ÄѵÀÊÇÖÆ¶¨¹¹Ô캯ÊýΪ×Ô¼º£¿ÔõôºÃÏñÈ¥ÁËҲûʲô¹ØÏµ¡£
Çë´ó¼ÒÉÔ΢ΪСµÜÖ
Ïà¹ØÎÊ´ð£º
ÈçºÎʵÏÖµ±Êó±êÐüÍ£¿Ø¼þÉÏʱ£¬³öÏָÿؼþµÄβ²¿ÏÔʾ¶ÔÓ¦µÄ²ã£¬Êó±êÒÆ¶¯µ½¸Ã²ãÉϽøÐÐÏàÓ¦µÄ²Ù×÷£¬µ±Êó±êÒÆ³ýʱ£¨²»ÔڿؼþÉÏÒ²²»ÔÚ²ãÉÏ£©²ãÒþ²Ø£¬
HTML code:
<html>
<head>
<meta http-equiv= ......
ÎÒµÄÔ´ÎļþÈçÏ£º
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
{
  ......
ÒÔÏÂÊÇÒ»¶ÎJavsScript½Å±¾£¬µ«ÔËÐÐʱ×Ü»á²úÉú ¡°Microsoft JScript ÔËÐÐʱ´íÎó: 'null' Ϊ¿Õ»ò²»ÊǶÔÏó¡±Òì³££¬´ó¼Ò°ï¿´Ò»Ï¡£
<form id="form1" runat="server">
< ......
ÎÒÓÐÒ»¶Îjavascript´úÂ룬Ա¾Ð´ÔÚasp .netÒ³ÃæÀÎÒÏë°ÑËüдÈëasp .netºǫ́´úÂëÖС£ÇëÎÊÒªÔõôд£¿Ð»Ð»£¡
Ò²¾ÍÊÇ˵´ÓaspxÎļþÖУ¬¸ÃΪдÈëaspx.csÖУ¬Çë¸øÊµÀý˵Ã÷¡£
寫ÁËÖ®ááÄã×öʲ麼²Ù×÷£¿
......
jspÒ³Ãæ1ÖУº
ÎÒ¶¨ÒåÁËÒ»¸ö±äÁ¿flag
<script language="javascript"> var flag=1£»</script>
jspÒ³Ãæ2ÖУº
ÔÚ´ËÒ³ÃæÖÐÏë»ñÈ¡flagÕâ¸ö±äÁ¿
<% String flag=request.getParameter(" ......