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

JavaScript ͼÏñµØͼ

 
ͼÏñµØͼָµÄÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£
ʵÀý
¼òµ¥µÄ HTML ͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùûÓÐÌí¼Ó JavaScript µÄͼÏñÓ³Éä¡£
Ìí¼ÓÁË JavaScript µÄͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùÌí¼ÓÁË JavaScript µÄͼÏñÓ³É䣬µ±Êó±ê¸¡¶¯ÓÚij¸öÈȵãÉÏʱ£¬»áµ÷Óà JavaScript º¯ÊýÀ´ÏÔʾÈȵãËù¶ÔÓ¦µÄÐÇÇòµÄ¼ò½é¡£
JavaScript ͼÏñµØͼ
ÎÒÃÇÒѾ­´Ó HTML ½Ì³ÌÖÐÁ˽⵽£¬Í¼ÏñµØͼÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£Í¨³£Çé¿öÏ£¬Ã¿¸öÇøÓòÊÇÒ»¸öÏà¹ØµÄ³¬¼¶Á´½Ó¡£µ¥»÷ij¸öÇøÓò£¬¾Í»Øµ½´ïÏà¹ØµÄÁ´½Ó¡£
ʵÀý
ÏÂÃæµÄÀý×ÓÑÝʾÈçºÎ´´½¨´øÓпɵã»÷ÇøÓòµÄ html ͼÏñµØͼ£º
<img src ="planets.gif" width ="145" height ="126"
alt="Planets"usemap ="#planetmap" />
<map id ="planetmap" name="planetmap">
<area shape ="rect" coords ="0,0,82,126" href ="sun.htm" target ="_blank"
alt="Sun" />
<area shape ="circle" coords ="90,58,3" href ="mercur.htm" target ="_blank"
alt="Mercury" />
<area shape ="circle" coords ="124,58,8" href ="venus.htm" target ="_blank"
alt="Venus" />
</map>
½á¹û
Ìí¼Ó JavaScript
ÎÒÃÇ¿ÉÏòͼÏñµØͼÄÚ²¿µÄ <area> ±êÇ©Ìí¼Ó£¨Äܵ÷ÓÃJavaScriptµÄ£©Ê¼þ¡£<area>
±êÇ©Ö§³ÖÒÔÏÂʼþ£ºonClick¡¢onDblClick¡¢onMouseDown¡¢onMouseUp¡¢onMouseOver¡¢
onMouseMove¡¢onMouseOut¡¢onKeyPress¡¢onKeyDown¡¢onKeyUp¡¢onFocusºÍonBlur¡£
ÕâÊÇÌí¼ÓÁË JavaScript µÄÉÏÃæµÄÀý×Ó£º
<html>
<head>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("desc").innerHTML=txt
}
</script>
</head>
<body>
<img src="planets.gif" width="145" height="126"
alt="Planets" usemap="#planetmap" />
<map id ="planetmap" name="planetmap">
<area shape ="rect" coords ="0,0,82,126"
onMouseOver
="writeText
('The Sun


Ïà¹ØÎĵµ£º

javascriptÕýÔò±í´ïʽ

JavaScript--ÕýÔò±í´ïʽ
ÕýÔò±í´ïʽ(regular expression)¶ÔÏó°üº¬Ò»¸öÕýÔò±í´ïʽģʽ(pattern)¡£Ëü¾ßÓÐÓÃÕýÔò±í´ïʽģʽȥƥÅä»ò´úÌæÒ»¸ö´®(string)ÖÐÌض¨×Ö·û(»ò×Ö·û¼¯ºÏ)µÄÊôÐÔ(properties)ºÍ·½·¨(methods)¡£
ÕýÔò±í´ïʽ¹¹Ô캯Êý£º new RegExp("pattern"[,"flags"]);
²ÎÊý˵Ã÷£º
pattern -- Ò»¸öÕýÔò±í´ïʽÎı¾
flag ......

JavaScript ¸´Ñ¡¿òµÄ·´Ñ¡

 
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ÎÞ±êÌâÒ³</title>
<mce:script language="javascript" type="te ......

JavaScriptʵÏÖÀàµÄ¼Ì³Ð

ÔÚJavaScriptÖÐûÓÐרÃŵĻúÖÆÀ´ÊµÏÖÀàµÄ¼Ì³Ð£¬µ«ÊÇ¿ÉÒÔͨ¹ý¿½±´Ò»¸öÀàµÄprototypeµ½ÁíÍâÒ»¸öÀàÀ´ÊµÏּ̳У¬Ò»ÖÖ¼òµ¥µÄʵÏÖÈçÏ£º
function class1(){
}
function class2(){
}
class2.prototype=class1.prototype;
class2.prototype.moreProperty="xxx";
class2.prototype.moreMethod1=function(){
}
var obj = ne ......

JavaScript NameSpace

    ÃüÃû¿Õ¼ä£¬Ò»¿´¾ÍÖªµÀÖ÷ҪĿµÄÊÇΪÁ˱ÜÃâ³åÍ»¡£ÏÂÃæ¾ÍÀ´ËµÒ»ÏÂÈçºÎ´òÔì×Ô¼ºµÄJavaScriptÃüÃû¿Õ¼ä¡£
    ´òÔìJavaScriptÃüÃû¿Õ¼äÆäʵºÜ¼òµ¥£¬Ö»ÐèÒª½«×Ô¼ºµÄº¯Êý¡¢¶ÔÏó¡¢±äÁ¿µÈ·ÅÔÚÒ»¸öαÃüÃû¿Õ¼äÖУ¬¼´ÓÃÒ»¸öÄäÃûº¯Êý°ü×°ÆðÀ´¡£
(function(){
    function $(id){
&n ......

JavaScriptͨÓÃAlertÃÀ»¯Àà

function sAlert(msg,boxtype,func,msgtitle)
sAlert('ÐÅÏ¢ÄÚÈÝ',1,'','ÐÅÏ¢±êÌâ')
@msg:ÌáʾÐÅÏ¢ÄÚÈÝ
@boxtype£º1Ϊµ¯³ö¿ò£¬2ΪȷÈÏ¿ò£¬3ΪÌáʾ¿ò
@func:µãÈ·ÈÏʱִÐеĺ¯Êý
@title:ÐÅÏ¢¿ò±êÌâÎÄ×ÖÄÚÈÝ
Ö»ÓÐmsgÊDZØÐëµÄ£¬ºóÃæµÄ²ÎÊý¿ÉÒÔÊ¡ÂÔ¡£Èç¹ûÖмäµÄ²ÎÊýΪ¿ÕÔòÔÚ¶ÔӦλÖÃÉÏ''»òÕß""±íʾ£¨¸ù¾Ýʵ¼ÊÇé¿öÑ¡Ôñµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ