JavaScriptÉè¼ÆģʽµÄÒ»ÖÖÓÐȤµÄ·âװС¼¼ÇÉ
javascriptÉè¼ÆģʽµÚÒ»ÕÅÓÐÒ»¸öÓÐȤµÄʵÏּ̳еķ½·¨£¬µ±È»javascript±¾ÖÊÉÏÊÇʵÏּ̳У¬»¹²»ÊǵäÐÍÒâÒåÉϵÄ"is-a"µÄÂß¼¼Ì³Ð»òÕß˵ÊÇÓïÒå¼Ì³Ð¡£»ù±¾µÄ·½·¨¾ÍÊÇͨ¹ýfunctionµÄprototypeÊôÐÔ¡£
Ò»£¬ºÜ¼òµ¥µÄ·½·¨
<script type="text/javascript">
<!--
var Anim = function(){};
Anim.prototype.start = function(){alert('start');};
Anim.prototype.stop = function(){alert('stop');};
var obj = new Anim();
obj.start();
obj.stop();
// -->
</script>
¶þ£¬°ÑprototypeµÄÕûÌ帳ֵ-¶ÔÏó×ÖÃæÁ¿·¨
<script type="text/javascript">
<!--
var Anim = function(){};
Anim.prototype = {
start:function(){alert('start');},
stop:function(){alert('stop');}
};
var obj = new Anim();
obj.start();
obj.stop();
// -->
</script>
×¢Ò⣺¶ÔprototypeÊôÐÔÕûÌ帳ֵֻÄÜÊÇÓû§×Ô¶¨ÒåµÄ¹¹Ô캯Êý£¬¶ÔjavascriptÄÚÖõĹ¹Ô캯ÊýÊDz»Äܵģ¬ÈçFunction.prototype= {};
ÊÇÎÞЧµÄ¡£
Èý£¬°ÑprototypeµÄ¸³ÖµÌáµ½Function¶ÔÏóµÄprototypeÀ´²Ù×÷¡£
<script type="text/javascript">
<!--
//¶ÔFunction¹¹Ô캯ÊýµÄprototypeÔö¼ÓÀ©Õź¯Êý
Function.prototype.extend = function(method, func){
this.prototype[method] = func;
return this; //Ö§³ÖÁ´Ê½²Ù×÷
};
//AnimÊÇеÄFunctionʵÀý£¬ËüµÄ[[prototype]]ÊÇÖ¸ÏòFunction.prototype£¬Òò´ËAnim.extend¿ÉÒÔͨ¹ýËÑË÷ÔÐÍÁ´
//¶øµ÷ÓÃFunction.prototype.extend·½·¨£¬¸Ã·½·¨·µ»Øthis£¬Ò²¾ÍÊǶÔÏóAnim
var Anim = function(){};
Anim.extend('start', function(){alert('start');}).extend('stop', function(){alert('stop');});
var obj = new Anim();
obj.start();
obj.stop();
// -->
</script>
Ïà¹ØÎĵµ£º
Link:http://topic.csdn.net/u/20100317/15/687e21bc-40f3-4f0e-bc22-5f2a32ceb1a3.html?seed=1664090183&r=63989333#r_63989333
<HTML>
<head>
<title>sample</title>
<mce:script language="JavaScript"><!--
var c="FFFFFF";
window.onload=function (){
setInterval(s ......
.XML Web services ÐÐΪʹ¿Í»§¶Ë½Å±¾Äܹ»µ÷ÓÃÓÉ Microsoft .NET XML Web services »òÆäËûÖ§³Ö¼òµ¥¶ÔÏó·ÃÎÊÐÒé (SOAP) µÄ Web ·þÎñÆ÷¹«¿ªµÄÔ¶³Ì·½·¨¡£
Ä¿µÄ£ºÌṩһÖÖ¼òµ¥µÄ·½·¨Ê¹ÓúÍÀûÓà SOAP£¬¶ø²»Ðè¾ßÓÐ SOAP ʵÏÖµÄרҵ֪ʶ¡£
²½Ö裺
1.ÏÂÔØWebservice.htc,Ðí¶àÍøÉϵÄÎÄÕ½éÉܸÃÎļþ¿ÉÒÔÔÚ΢ÈíµÄÍøÕ¾ÉÏÕÒµ½£¬µ«ÎÒ°´ ......
JavaScript¼üÅÌʼþÕìÌý
ÔÚʹÓÃJavaScript×öWEB¼üÅÌʼþÕìÌý²¶»ñʱ£¬Ö÷Òª²ÉÓÃonkeypress¡¢onkeydown¡¢onkeyupÈý¸öʼþ½øÐгöÀ´¡£¸ÃÈý¸öʼþµÄÖ´ÐÐ˳ÐòÈçÏ£ºonkeydown -> onkeypress ->onkeyup¡£ÔÚÒ»°ãÇé¿öÏ£¬²ÉÓÃÈýÖÖ¼üÅÌʼþ¾ù¿É¶Ô¼üÅÌÊäÈë½øÐÐÓÐЧµÄÏìÓ¦¡£µ±ÔÚʵ¼ÊʹÓÃÖУ¬»á·¢ÏÖÕ⼸ÕßÓÐЩ²»Í¬µÄ²î±ð¡£
......
function get_cookie(Name)
{
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0)
{
var offset = document.cookie.indexOf(search)
if (offset != -1)
{
&nbs ......
Javascriptº¯ÊýÀàÐÍÅжÏÍêÃÀ½â¾ö·½°¸
ÔÚÅжϺ¯ÊýÀàÐÍʱ£¬ÎÒÃÇͨ³£Ê¹ÓÃtypeof·½·¨£¬Ò»°ãÇé¿öÏ£¬Ëü»áµÃµ½ÎÒÃÇËùÔ¤ÏëµÄЧ¹û¡£µ«ÊÇ£¬ÓÐһЩϸ½Ú²¢²»ÎªÎÒÃÇËùÊìÖª¡£John Resig ÔÚ·ÖÎöÁËÕâЩϸ½ÚÖ®ºó£¬ÎªÎÒÃÇÌṩÁËÒ»¸öÍêÃÀµÄ½â¾ö·½°¸£¬±¾ÎĽ«×÷Ïêϸ½éÉÜ£º
Ò»¡¢´«Í³·½·¨²»ÎªÈËËùÖªµÄϸ½Ú
ºÁÎÞÒÉÎÊ£¬ÔÚÅжϺ¯ÊýÀàÐÍʱ£¬ÎÒÃÇÊ ......