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

JavaScript FAQ£¨¶þÊ®ËÄ£©

¶þʮһ¡¢ÉùÒô
1¡¢¿ÉÒÔ²¥·ÅÉùÒôµÄä¯ÀÀÆ÷£¨Audio-enabled Browsers£©
Q£ºÊ²Ã´¿ÉÒÔä¯ÀÀÆ÷¿ÉÒÔÖ´Ðв¥·ÅÉùÒôµÄ½Å±¾£¿
A£ºÈç¹ûÔÚÉùÒô²¥·ÅÃèÊöµÄ¼¼Êõ¿ÉÒÔÔÚMiscrosoft Internet Explorer 4.0¼°Æä¸üа汾Öй¤×÷£¬ÄÇôͬÑù¿ÉÒÔÔÚNetscape Navigator 3.0¼°Æä¸üа汾Öй¤×÷¡£ÒªÔÚInternet ExplorerÖв¥·ÅÉùÒô£¬ÔÚ4.0ÒÔ¼°ºóÀ´°æ±¾ÖвâÊÔ¾Í×ã¹»ÁË¡£È»ºóÔÚNetscape NavigatorÖУ¬Äã±ØÐëÈ·±£ÒÔϼ¸µã£º
ä¯ÀÀÆ÷°æ±¾ÊÇ3.0»òÕ߸üа汾
ÆôÓÃJava£¨²»½ö½öÊÇJavaScript£¡£©
ä¯ÀÀÆ÷Äܹ»Ê¶±ðÄãÒª²¥·ÅÒôƵÎļþµÄmimeÀàÐÍ
LiveAudio²å¼þ¿ÉÓÃ
ÀýÈ磬Èç¹ûÄãÏëÔÚÏÂÃæµÄEMBED±ê¼ÇÖв¥·ÅÉùÒôÎļþmySound.mid
<EMBED NAME="mySound" SRC="mySound.mid" mce_SRC="mySound.mid"
LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>
ÄÇô£¬¾ÍÐèҪʹÓÃÏÂÃæµÄ´úÂë½øÐвâÊÔ£º
ver=parseInt(navigator.appVersion)
if (ver>2 && navigator.appName=="Netscape"
&& navigator.mimeTypes['audio/x-midi']
&& navigator.javaEnabled()
&& document.mySound.IsReady() )
{
// put Netscape-specific code here
}
if (ver>3 && navigator.appName.indexOf("Microsoft")!=-1)
{
// put Explorer-specific code here
}
2¡¢ÒôƵÎļþ¸ñʽ£¨Audio File Formats£©
Q£ºÍøÒ³¿ÉÒÔ²¥·ÅÄÇЩÀàÐ͵ÄÒôƵÎļþ£¿
A£ºËùÓÐÆôÓÃÒôƵµÄä¯ÀÀÆ÷¶¼Ö§³Ö»Ø·ÅWAVºÍMIDI¸ñʽ£¨.mid¡¢.midiºÍ.wavÎļþ£©µÄÒôƵÎļþ¡£¸ù¾ÝÓû§ä¯ÀÀÆ÷ºÍϵͳÅäÖõIJ»Í¬µÄ£¬ÆäËû¸ñʽÎļþÒ²ÐíÖ§³Ö»ò²»Ö§³Ö¡£ÀýÈ磬ReadAudioÖ»ÄÜÓû§°²×°ÁËRealPlayer²Å¿ÉÒԻطš£
3¡¢Ê¹ÓÃJavaScript²¥·ÅÉùÒô£¨Playing Sound from JavaScript£©
Q£ºÎÒÈçºÎ±àдһ¸ö²¥·ÅÉùÒôJavaScript½Å±¾ÄØ£¿
A£ºÓм¸ÖÖ²»Í¬µÄ·½Ê½¿ÉÒÔͨ¹ýJavaScript²¥·ÅÉùÒô¡£ÎÒÃÇÀ´¿´¼¸¸öÀý×Ó£º
ʾÀý1. ÕâÊÇÒ»¸ö×î¼òµ¥µÄ²¥·ÅÉùÒôÎļþµÄ¿çä¯ÀÀÆ÷½Å±¾£º
self.location="AUDIO_FILE_URL"
µã»÷ÕâÀï²âÊÔʾÀý1´úÂë¡£ä¯ÀÀÆ÷»á´ò¿ªÒ»¸öµ¥¶ÀµÄÉùÒô¿ØÖÆ´°¿Ú¡£ÄÇôÓû§ÐèÒªÊÖ¶¯¹Ø±ÕÕâ¸ö´°¿Ú¡£×¢Ò⣬ʾÀý1¶ÔÓû§²¢²»ÓѺãºÓû§Ã¿Ò»´Îµã»÷ÔËÐнű¾£¬ä¯ÀÀÆ÷¶¼»á´ò¿ªÒ»¸öеÄÉùÒô¿ØÖÆ´°¿Ú£¬¼´Ê¹ÒѾ­ÓÐÒôƵ´°¿ÚÒѾ­ÔÚ²¥·ÅͬÑùµÄÎļþ£¡
ʾÀý2. ÕâÊÇÒ»¸ö¸ü¼Ó¸´ÔÓµÄÀý×Ó£¬Õâ¸öÀý×ÓûÓе¥¶ÀµÄÉùÒô¿ØÖÆ´°¿Ú¡££¨ÏÂÃæÓйØÓÚÕâ¸öÀý×ÓµÄÌÖ


Ïà¹ØÎĵµ£º

Javascript±Õ°ü£¨Closure£©


±Õ°ü£¨closure£©ÊÇJavascriptÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇËüµÄÌØÉ«£¬ºÜ¶à¸ß¼¶Ó¦Óö¼ÒªÒÀ¿¿±Õ°üʵÏÖ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄѧϰ±Ê¼Ç£¬¶ÔÓÚJavascript³õѧÕßÓ¦¸ÃÊǺÜÓÐÓõġ£
Ò»¡¢±äÁ¿µÄ×÷ÓÃÓò
ÒªÀí½â±Õ°ü£¬Ê×ÏȱØÐëÀí½âJavascriptÌØÊâµÄ±äÁ¿×÷ÓÃÓò¡£
±äÁ¿µÄ×÷ÓÃÓòÎ޷ǾÍÊÇÁ½ÖÖ£ºÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£
JavascriptÓïÑÔµÄÌØÊâÖ®´¦£¬¾ÍÔ ......

ÈçºÎ±ÜÃâJavascriptʼþ°ó¶¨³öÏÖÄÚ´æй©

"These memory leaks often
occur as a result of circular references between JavaScript objects and
objects within IE’s DOM (document object model)."
GPDE Team Blog
Ã÷ÏÔµÄDOM¶ÔÏóÓë JavaScript¶ÔÏóÑ­»·ÒýÓúܺÃÅжϣ¬ÄѵÄÊÇÒþº¬µÄÑ­»·ÒýÓÃÅжϣ¡
Òþº¬µÄÑ­»·ÒýÓÃÐèҪͨ¹ý×÷ÓÃÓòÁ´½øÐзÖÎöÅÐ ......

JavaScriptÈ¥³ý¿Õ¸ñµÄÈýÖÖ·½·¨ (trim)

·½·¨Ò»:
¸öÈËÈÏΪ×îºÃµÄ·½·¨.²ÉÓõÄÊÇÕýÔò±í´ïʽ,ÕâÊÇ×îºËÐĵÄÔ­Àí.
Æä´Î.Õâ¸ö·½·¨Ê¹ÓÃÁËJavaScript µÄprototype ÊôÐÔ
ÆäʵÄ㲻ʹÓÃÕâ¸öÊôÐÔÒ»Ñù¿ÉÒÔÓú¯ÊýʵÏÖ.µ«ÕâÑù×öºóÓÃÆðÀ´±È½Ï·½±ã.
ÏÂÃæ¾ÍÀ´¿´¿´Õâ¸öÊôÐÔÊÇÔõôÀ´ÓõÄ.
 
·µ»Ø¶ÔÏóÀàÐÍÔ­Ð͵ÄÒýÓá£
objectName.prototype
objectName ²ÎÊýÊǶÔÏóµÄÃû³Æ¡£ ......

javascript µÃµ½µ±Ç°Ò³Ãæ¿ÉÊӸ߶ȺͿí¶È

function getHeight(){
    var yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offs ......

javascript ¸÷Öֵõ½ä¯ÀÀÆ÷¿í¶ÈºÍ¸ß¶ÈµÄº¯Êý

function getInfo()
{
    var s = "";
    s += " ÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth+"\n";
    s += " ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight+"\n";
    s += " ÍøÒ³¿É¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ