JavaScript¶¨ÒåÀàµÄ¼¸ÖÖ·½Ê½
ÌáÆðÃæÏò¶ÔÏóÎÒÃǾÍÄÜÏëµ½À࣬¶ÔÏ󣬷â×°£¬¼Ì³Ð£¬¶à̬¡£ÔÚ¡¶javaScript¸ß¼¶³ÌÐòÉè¼Æ¡·£¨ÈËÃñÓʵç³ö°æÉ磬²ÜÁ¦¡¢ÕÅÐÀÒë¡£Ó¢ÎÄÃû×ÖÊÇ£ºProfessional JavaScript for Web Developers£©Õâ±¾ÊéÖÐÃèÊöµÄ»¹Ëã±È½ÏÏêϸ¡£ÎÒÃÇ¿´¿´JavaScriptÖж¨ÒåÀàµÄ¸÷ÖÖ·½·¨¡£
1£®¹¤³§·½Ê½
javaScriptÖд´½¨×Ô¼ºµÄÀàºÍ¶ÔÏó£¬ÎÒÃÇÓ¦¸ÃÊDZØÐëÕÆÎյģ¬ÎÒÃǶ¼ÖªµÀjavaScriptÖжÔÏóµÄÊôÐÔ¿ÉÒÔÔÚ¶ÔÏó´´½¨ºó¶¯Ì¬¶¨Ò壬±ÈÈçÏÂÃæµÄ´úÂ룺
<script type="text/javascript">
//¶¨Òå
var oCar = new Object();
oCar.color = "red";
oCar.doors = 4;
oCar.showColor = function() {
alert(this.color);
}
//µ÷ÓÃ
oCar.showColor();
</script>
ÎÒÃǺÜÈÝÒ×ʹÓÃoCar¶ÔÏ󣬵«ÊÇÎÒÃÇ´´¾ÍÊÇÏë´´½¨¶à¸öCarʵÀý¡£ÎÒÃÇ¿ÉÒÔʹÓÃÒ»¸öº¯ÊýÀ´·â×°ÉÏÃæµÄ´úÂëÀ´ÊµÏÖ£º<script type="text/javascript">
//¶¨Òå
function createCar() {
var oCar = new Object();
oCar.color = "red";
oCar.doors = 4;
oCar.showColor = function() {
alert(this.color);
}
return oCar;
}
//µ÷ÓÃ
var ocar1 = createCar();
var ocar2 = createCar();
ocar1.color = "black";
ocar1.showColor();
ocar2.showColor();
</script>
˳±ã˵һÏ£¬javaScript¶ÔÏóĬÈϳÉÔ±ÊôÐÔ¶¼ÊÇpublic µÄ¡£ÕâÖÖ·½Ê½ÎÒÃdzÆÎª¹¤³§·½Ê½£¬ÎÒÃÇ´´ÔìÁËÄÜ´´½¨²¢·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄ¹¤³§¡£
ÕâÑù×öÓеãÒâ˼ÁË£¬µ«ÊÇÔÚÃæÏò¶ÔÏóÖÐÎÒÃǾ³£Ê¹Óô´½¨¶ÔÏóµÄ·½·¨ÊÇ£º
Car car=new Car();
ʹÓÃnew ¹Ø¼ü×ÖÒѾÉîÈëÈËÐÄ£
Ïà¹ØÎĵµ£º
ugmbbc·¢²¼ÓÚ 2009-11-14 09:41:43| 7628 ´ÎÔĶÁ ×ÖÌ壺´ó С ´òÓ¡Ô¤ÀÀ
var ReTitle = '»Ø¸´:Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â';
¸ÐлCOMSHARP CMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ ......
<html>
<head>
<mce:script language="javascript"><!--
function old_page()
{
window.location = "http://www.jb51.net"
}
function replace()
{
window.location.replace("http://www.jb51.net")
}
function new_page()
{
window.op ......
EventÊôÐԺͷ½·¨£º
1. type£ºÊ¼þµÄÀàÐÍ£¬ÈçonlickÖеÄclick£»
2. srcElement/target£ºÊ¼þÔ´£¬¾ÍÊÇ·¢ÉúʼþµÄÔªËØ£»
3. button£ºÉùÃ÷±»°´ÏµÄÊó±ê¼ü£¬ÕûÊý£¬1´ú±í×ó¼ü£¬2´ú±íÓÒ¼ü£¬4´ú±íÖмü£¬Èç¹û°´Ï¶à¸ö¼ü£¬¾Æ°ÑÕâЩֵ¼ÓÆðÀ´£¬ËùÒÔ3¾Í´ú±í×óÓÒ¼üͬʱ°´Ï£»£¨firefoxÖÐ 0´ú±í×ó¼ü£¬1´ú±íÖмä¼ü£¬2´ú±íÓÒ¼ü£© ......
ÑÝʾµØÖ·: http://www.wowo-design.com/view/51_01/index.htm
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css²Ëµ¥ÑÝʾ</title>
<style type="text/css">
<!--
*{margin:0;padding:0;border:0;}
body {
......
´ËÀý×ÓÊÇjavascript¸ß¼¶³ÌÐòÉè¼ÆÀïµÄ
·Å³öÀ´Ðı¸ÒÔºóʹÓá£ÉÏ´úÂë¡£
<html>
<head>
<title>Table Sort Example</title>
<mce:script type="text/javascript"><!--
function convert(sValue, sDataType) {
swi ......