Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScriptÖ®ÐÅÏ¢µÄ·â×°

/*
* JavaScriptÖ®ÐÅÏ¢µÄ·â×°
* ÔÚ±àÂëÇ°£¬ÎÒÃÇÐèÒªÁ˽âÈçϼ¸¸öÊõÓ
* ·â×°£º¶ÔÄÚ²¿Êý¾ÝµÄ±íÏÖÐÎʽºÍʵʩϸ½Ú½øÐÐÒþ²Ø£»
* ˽ÓÐÊôÐԺͷ½·¨£ºÍâ½çÖ»ÄÜͨ¹ýÆ乫¿ªµÄ½Ó¿ÚÓëÆä½øÐдæÈ¡ºÍ½»»¥
* ×÷ÓÃÓò£ºJavaScriptÖУ¬Ö»Óк¯Êý¾ßÓÐ×÷ÓÃÓò£¬º¯ÊýÄÚ²¿¶¨ÒåµÄÊôÐԺͷ½·¨ÔÚÍⲿÎÞ·¨·ÃÎÊ
* ÌØȨ·½·¨£ºÉùÃ÷ÔÚº¯ÊýÄÚ²¿£¬ÄÜ·ÃÎʺ¯ÊýÄÚ²¿±äÁ¿£¨ÊôÐÔ£©µÄ·½·¨£¬±È½ÏºÄ·ÑÄڴ棻
*/
function Person()
{
/*
* ÉùÃ÷˽ÓеÄÊý¾Ý
* êdzƣ¬ÄêÁ䣬ÓÊÏä
*/
var nickName, age, email;
/*
* ÐèÒª·ÃÎÊ˽ÓÐÊý¾ÝµÄ·½·¨(ÌØȨ·½·¨)
* ÿÉú³ÉÒ»¸öʵÀý½«ÎªÌØȨ·½·¨Éú³ÉÒ»¸öеĸ±±¾
*/
this.setData = function(pNickName, pAge, pEmail)
{
nickName = pNickName;
age = pAge;
email = pEmail
};
this.getData = function()
{
return [nickName, age, email];
}
}
/*
* ²»ÐèÒªÖ±½Ó·ÃÎÊ˽ÓÐÊý¾ÝµÄ·½·¨£¨¹«Óз½·¨£©
* ²»¹ÜÉú³É¶àÉÙʵÀý£¬¹«Óз½·¨ÔÚÄÚ´æÖÐÖ»´æÔÚÒ»·Ý
*/
Person.prototype = {
showData: function()
{
alert("¸öÈËÐÅÏ¢£º" + this.getData().join());
}
}
/*
* Íⲿ´úÂëͨ¹ý˽Óлò¹«Óз½·¨´æÈ¡ÄÚ²¿ÊôÐÔ
*/
var p = new Person();
p.setData("sky", "26", "vece@vip.qq.com");
p.showData();


Ïà¹ØÎĵµ£º

Ïêϸ½â¶ÁJavaScriptµÄthis¹Ø¼ü×Ö


ÓÃÁ˺ܾÃJavaScript£¬¶Ô¡¾this¡¿µÄÈÏʶֻ¾ÖÏÞÓÚÒÔÍùµÄƾ¾­Ñé¶øÒÑ£¬²»¹ý½ñÌì·¢ÏÖÁ˺ö«Î÷“http://www.quirksmode.org/js/associative.html”£¬ÏêϸÃèÊöÁËÈçºÎʹÓá¾this¡¿¹Ø¼ü×Ö£¬ÔÚÕâÀïÎҾͼò¶ÌµÄ˵һÏÂÖص㣬Èç¹ûÓÐÒÉÎÊ¿ÉÒÔÖ±½Ó²Î¿¼Ô­ÎÄ¡£
ÔÚѧϰ¹ýÓÐthisµÄ±à³ÌÓïÑÔÖУ¬thisÒ»°ã¶¼ÊÇÖ¸Ïòµ±Ç°ÊµÀý¶ÔÏóµÄ£¬¶ÔÓ ......

Javascript ×Ö·û´® substring Óë substr Çø±ð

stringObject.substring(start,end);
º¯Êý·½·¨½«·µ»ØÒ»¸ö°üº¬´Ó start µ½×îºó£¨²»°üº¬ end £©µÄ×Ó×Ö·û´®µÄ×Ö·û´®.
start     ±ØÐè¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬¹æ¶¨ÒªÌáÈ¡µÄ×Ó´®µÄµÚÒ»¸ö×Ö·ûÔÚ stringObject ÖеÄλÖÃ.
stop     ¿ÉÑ¡¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬±ÈÒªÌáÈ¡µÄ×Ó´®µÄ×îºóÒ»¸ö×Ö·ûÔÚ stringObject ......

JavascriptÖ®ä¯ÀÀÆ÷¶ÔÏó


ä¯ÀÀÆ÷¶ÔÏó
 
 
ä¯ÀÀÆ÷¶ÔÏó¾ÍÊÇÍøÒ³ºÍä¯ÀÀÆ÷±¾Éí¸÷ÖÖʵÌåÔªËØÔÚJavaScript³ÌÐòÖеÄÌåÏÖ¡£ÕâÑùµÄä¯ÀÀÆ÷¶ÔÏóÖ÷Òª°üÀ¨ÒÔϼ¸¸ö
¡ñ  Navigator£º¹ÜÀíÕßµ±Ç°Ê¹ÓÃä¯ÀÀÆ÷µÄ°æ±¾ºÅ¡¢ÔËÐеÄƽ̨ÒÔ¼°ä¯ÀÀÆ÷ʹÓõÄÓïÑÔµÈÐÅÏ¢¡£
¡ñ  Windows¶ÔÏ󣺴¦ÓÚÕû¸ö´ÓÊô±íµÄ×¼¶Î»Öá£Ã¿Ò»¸öÕâÑùµÄ¶ÔÏó´ú±íÒ»¸öä¯ÀÀ ......

ÉîÈëÈÏʶjavascriptÖеÄevalº¯Êý

ÉîÈëÈÏʶjavascriptÖеÄevalº¯Êý
·ÖÀࣺ¼¼ÊõרÇøʱ¼ä£º2007-5-21 15:04:58×÷ÕߣºsupNate  
         ·¢ÏÖΪ±¾ÎÄÆðÒ»¸öºÏÊʵıêÌ⻹²»ÊÇÄÇôÈÝÒ×£¬ºÇºÇ£¬ËùÒÔÔÚ´ËÏÈ˵Ã÷ϱ¾ÎĵÄÁ½¸öÄ¿µÄ£º
£¨1£©½éÉÜjavascriptÖеÄevalº¯ÊýµÄÓ÷¨
£¨2£©ÈçºÎÔÚº¯ÊýÄÚÖ´ÐÐÈ«¾Ö´úÂë
► ......

javascriptС¼¼ÇÉ

ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type ²¶»ñÊÍ·Å
event.srcElement.setCapture(); 

event.srcElement.releaseCapture();  ʼþ°´¼ü
event.keyCode
event.shiftKey

event.altKey
event.ctrlKey ʼþ·µ»ØÖµ
event.returnValue Êó±êλÖÃ
event.x

event.y ´°Ìå»î¶¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ