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£¬Ò²Äܹ¹½¨Ò»Ð©´óÐÍÄ£¿é¡£
Ïà¹ØÎĵµ£º
1. document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];
FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿É ......
**
* ÎÒÔÚÍøÉÏ¿´µ½¹ýºÜ¶àBASE64µÄJavaScriptËã·¨£¬¶¼¾õµÃ²»ÂúÒ⣬ÓÚÊÇ×Ô¼ºÐ´ÁËÒ»¸ö£¬ÔÚÕâÀï·ÖÏíһϡ£
* ÎҵĴúÂëÔÚÖÊÁ¿µÄЧÂʶ¼½Ï¸ß£¬Ã»ÓÐһЩÈßÓàµÄ²Ù×÷¡£×ÜÌåÀ´½²ÎÒ¾õµÃ·Ç³£²»´í¡£
* Èç¹û´ó¼ÒÓÐʲô²»¶®µÄµØ·½¿ÉÒÔÎÊÎÒ¡£
*/
var BASE64={
/**
* ´Ë±äÁ¿Îª±àÂëµÄ ......
Nested Members ǶÌ׳ÉÔ±
Since object members may contain other members, it's not uncommon to see patterns such as window.location.href in JavaScript code. These nested members cause the JavaScript engine to go through the object member resolution process each time a dot is ......
function db()
{
//»î¶¯±àºÅ
var activeid = Request.Form("activeid");
//̞
var username = Request.Form("username");
//ÊÖ»úºÅÂë
var mobile = Request.Form("mobile");
var conn= Server.CreateObject("ADODB.connection");
var rs= Serve ......
JavaScriptʼþ´óÈ«
click() ¶ÔÏó.click() ʹ¶ÔÏó±»µã»÷¡£
closed ¶ÔÏó.closed ¶ÔÏó´°¿ÚÊÇ·ñÒѹرÕtrue/false
clearTimeout(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetTimeout¶ÔÏó
clearInterval(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetInterval¶ÔÏó
confirm("ÌáʾÐÅÏ¢") µ¯³öÈ·ÈÏ¿ò£¬È·¶¨·µ»ØtrueÈ¡Ïû·µ»Øfalse
cursor:Ñùʽ ¸ü¸ÄÊó±êÑùÊ ......