javascript È¥¿Õ¸ñ ÔÐÍÐÞ¸Ä
¸öÈËÈÏΪ×îºÃµÄ·½·¨²ÉÓõÄÊÇÕýÔò±í´ïʽ,ÕâÊÇ×îºËÐĵÄÔÀí.
Æä´Î.Õâ¸ö·½·¨Ê¹ÓÃÁËJavaScript µÄprototype ÊôÐÔ
ÆäʵÄ㲻ʹÓÃÕâ¸öÊôÐÔÒ»Ñù¿ÉÒÔÓú¯ÊýʵÏÖ.µ«ÕâÑù×öºóÓÃÆðÀ´±È½Ï·½±ã.
ÏÂÃæ¾ÍÀ´¿´¿´Õâ¸öÊôÐÔÊÇÔõôÀ´ÓõÄ.
·µ»Ø¶ÔÏóÀàÐÍÔÐ͵ÄÒýÓá£
objectName.prototype
objectName ²ÎÊýÊǶÔÏóµÄÃû³Æ¡£
˵Ã÷
Óà prototype ÊôÐÔÌṩ¶ÔÏóµÄÀàµÄÒ»×é»ù±¾¹¦ÄÜ¡£¶ÔÏóµÄÐÂʵÀý“¼Ì³Ð”¸³Óè¸Ã¶ÔÏóÔÐ͵IJÙ×÷¡£
ÀýÈ磬ҪΪ Array ¶ÔÏóÌí¼Ó·µ»ØÊý×éÖÐ×î´óÔªËØÖµµÄ·½·¨¡£ÒªÍê³ÉÕâÒ»µã£¬ÉùÃ÷¸Ãº¯Êý£¬½«Ëü¼ÓÈë Array.prototype£¬²¢Ê¹ÓÃËü¡£
function array_max( ){
var i, max = this[0];
for (i = 1; i < this.length; i++)
{
if (max < this[i])
max = this[i];
}
return max;
}
Array.prototype.max = array_max;
var x = new Array(1, 2, 3, 4, 5, 6);
var y = x.max( );
¸Ã´úÂëÖ´Ðкó£¬y ±£´æÊý×é x ÖеÄ×î´óÖµ£¬»ò˵ 6¡£
ËùÓÐ JScript ÄÚ²¿¶ÔÏó¶¼ÓÐÖ»¶ÁµÄ prototype ÊôÐÔ¡£¿ÉÒÔÏó¸ÃÀýÖÐÄÇÑùΪÔÐÍÌí¼Ó¹¦ÄÜ£¬µ«¸Ã¶ÔÏó²»Äܱ»¸³Ó費ͬµÄÔÐÍ¡£È»¶ø£¬Óû§¶¨ÒåµÄ¶ÔÏó¿ÉÒÔ±»¸³¸øÐµÄÔÐÍ¡£
±¾ÓïÑԲο¼ÖÐÿ¸öÄÚ²¿¶ÔÏóµÄ·½·¨ºÍÊôÐÔÁбíÖ¸³öÄÄЩÊǶÔÏóÔÐ͵IJ¿·Ö£¬ÄÄЩ²»ÊÇ¡£
ÏÂÃæÊÇ´úÂëÔÎÄ
³ÌÐò´úÂë
Java´úÂë
<SCRIPT LANGUAGE="JavaScript">
<!--
//³ö´¦:ÍøÉÏËѼ¯
//made by yaosansi 2005-12-02
//For more visit http://www.yaosansi.com
// trim() , lTrim() , rTrim()
String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.lTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.rTrim = function()
{
return&nb
Ïà¹ØÎĵµ£º
4.9
×÷ÓÃÓò
ÔÚ±à³ÌÓïÑÔÖУ¬×÷ÓÃÓò¿ØÖÆ×űäÁ¿Óë²ÎÊýµÄ¿É¼ûÐÔ¼°ÉúÃüÖÜÆÚ¡£¶Ô³ÌÐòÔ±À´ËµÕâÊÇÒ»¸öÖØÒªµÄ°ïÖú£¬ÒòΪËü¼õÉÙÁËÃû³Æ³åÍ»£¬²¢ÇÒÌṩÁË×Ô¶¯ÄÚ´æ¹ÜÀí¡£
´ó¶àÊýʹÓÃCÓïÑÔÓï·¨µÄÓïÑÔ¶¼ÓµÓп鼶×÷ÓÃÓò¡£ÔÚÒ»¸ö´úÂë¿éÖУ¨À¨ÔÚÒ»¶Ô»¨À¨ºÅÖеÄÓï¾ä¼¯£©¶¨ÒåµÄËùÓбäÁ¿ÔÚ´úÂë¿éµÄÍⲿÊDz»¿É¼ûµÄ¡£¶¨ÒåÔÚ´ú
 ......
µÚ6ÕÂ
Êý×é
Êý×éÊÇÒ»¶ÎÏßÐÔ·ÖÅäµÄÄڴ棬Ëüͨ
¹ýÕûÊýÈ¥¼ÆËãÆ«ÒÆ²¢·ÃÎÊÆäÖеÄÔªËØ¡£Êý×é¿ÉÒÔÊǺܿìµÄÊý¾Ý½á¹¹¡£²»ÐÒµÄÊÇ£¬
JavaScript
µÄÊý×é²»ÊÇÕâÑùµÄ¡£ËüÌṩÁËÒ»ÖÖÓµÓÐÀàËÆÊý×éÌØÐԵĶÔÏó¡£Ëü°ÑÊý×éµÄϱêת±ä³É×Ö·û´®£¬ÓÃÆä×÷ΪÊô
ÐÔ¡£ËüÃ÷ÏԵرÈÒ»¸öÕæÕýµÄÊý×éÂý£¬µ«Ëü¿ÉÒÔ¸ü·½±ãµØÊ¹Óá£ÊôÐԵļìË÷ºÍ¸ü ......
http://blog.csdn.net/mouyong/archive/2010/01/10/5169396.aspx
µÚ5Õ ¼Ì³Ð
ÔÚÄÇЩ»ùÓÚÀàµÄÓïÑÔ£¨±ÈÈçJava£©ÖУ¬¼Ì³Ð£¨inheritance»òextends£©ÌṩÁËÁ½¸öÓÐÓõķþÎñ¡£Ê×ÏÈ£¬ËüÊÇ´úÂëÖØÓõÄÒ»ÖÖÐÎʽ¡£Èç¹ûÒ»¸öеÄÀàÓëÒ»¸öÒÑ´æÔÚµÄÀà´ó²¿·ÖÏàËÆ£¬ÄÇôÄãÖ»Ðë¾ßÌå˵Ã÷Æä²»Í¬µã¼´¿É¡£Àà¼Ì³ÐµÄÁíÒ»¸öºÃ´¦ÊÇËü°üÀ¨Á ......
http://blog.csdn.net/mouyong/archive/2010/01/31/5275562.aspx
µÚ7Õ ÕýÔò±í´ïʽ
JavaScriptµÄÐí¶àÌØÐÔ¶¼½è¼ø×ÔÆäËûÓïÑÔ¡£Óï·¨½è¼ø×ÔJava£¬º¯Êý½è¼ø×ÔScheme£¬ÔÐÍ¼Ì³Ð½è¼ø×ÔSelf¡£¶øJavaScriptµÄÕýÔò±í´ïÊ½ÌØÐÔÔò½è¼ø×ÔPerl¡£
ÕýÔò±í´ïʽÆðÔ´ÓÚ¶ÔÐÎʽÓïÑÔµÄÊýѧÑо¿¡£
ÔÚJavaScriptÖУ¬ÕýÔò±í´ïʽµÄÓï· ......
function testExe(entityId, wfId) {
var id = crmForm.ObjectId;
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http:/ ......