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

JavaScript¹ýÂËÊý×éÖÐÖØ¸´ÔªËØ

JavaScript¹ýÂËÊý×éÖÐÖØ¸´ÔªËØ
ÎÒÊǸöJS³õѧÕߣ¬ÎÒ¼´½«ÒªËµµÄÕâ¸ö·½·¨Ò²ÊǴ󲿷ÖÈ˶¼ÄÜÏëµ½µÄ£º
´Ó¾ÉÊý×éÖÐÈ¡ÔªËØ£¬Ò»¸ö¸öÌí¼Óµ½ÐÂÊý×éÖУ¬ÔÚÌí¼ÓµÄʱºò£¬ÓëÌí¼Ó¹ýµÄÔªËØ±È½Ï£¬Èç¹ûÏàͬ£¬Ôò²»Ìí¼Ó¡£
Ê×Ïȶ¨ÒåÁ½¸öÊý×飺
Code
var arrA = new Array(1,23,43,64,1,23,5,8,3,5,9);
var arrB = getNewArray(arrA);  // ¹ýÂ˺¯Êý
È»ºó¿ªÊ¼±àдº¯ÊýgetNewArray()
 Code
function getNewArray(receiveArray) 
{
    var arrResult = new Array();  //¶¨ÒåÒ»¸ö·µ»Ø½á¹ûÊý×é.
    for (var i=0; i<receiveArray.length; i++)
    {
        if (/*ÔÚÕâÀï×öiÔªËØÓëËùÓÐÅжÏÏàͬÓë·ñ, µ÷Óú¯Êýcheck(arrResult, receiveArray[i]);*/)
        {
            arrResult.push(receiveArray[i]); // Ìí¼Ó¸ÃÔªËØµ½ÐÂÊý×é¡£Èç¹ûifÄÚÅжÏΪfalse£¨¼´ÒÑÌí¼Ó¹ý£©£¬Ôò²»Ìí¼Ó¡£
        }
    }
    return arrResult;
}
È»ºó±àдÅжϺ¯Êýcheck()
 Code
function check(receiveArray, checkItem)
{
    var index = -1;  // º¯Êý·µ»ØÖµÓÃÓÚ²¼¶ûÅжÏ
    for (var i=0; i<receiveArray.length; i++)  
    {
        if (receiveArray[i]==checkItem)  
        {
            index = i;
            break;
        }
    }
    return index;
}
ÔòÔÚº¯ÊýgetNewArray()ÖеÄifÓ¦¸Ãд³É:
 Code
chec


Ïà¹ØÎĵµ£º

javascriptÅжϱäÁ¿ÀàÐ͵Ä×Ô¶¨Ò庯Êý

ͨ³£ÓÃtypeofÀ´ÅжÏjs±äÁ¿µÄÀàÐÍ£¬µ«ºÜ¶àʱºò½ö½ötypeofÂú×ã²»ÁËÒªÇóµÄ¡£
ÎÒдÁËÒ»¸ö×Ô¶¨Ò庯ÊýÀ´×öÕâ¸öÊ£¬ÅжϵıȽÏÈ«ÃæÁË¡£
New
function
varType(v){

  if
(
typeof
v===
"object"
){

    if
(v===
null
)
return
'null'
;

    if
(v.
constructo ......

href=¡°#¡±Óëhref=¡°javascript:void(0)¡±Çø±ð

ʹÓùýajaxµÄ¶¼³£¼ûÕâÑùµÄ´úÂ룺
<a href="javascript:doTest2();void(0);" mce_href="javascript:doTest2();void(0);">here</a>
µ«Õâ¶ùµÄvoid(0)¾¿¾¹ÊǺκ¬ÒåÄØ£¿
JavascriptÖÐvoidÊÇÒ»¸ö²Ù×÷·û£¬¸Ã²Ù×÷·ûÖ¸¶¨Òª¼ÆËãÒ»¸ö±í´ïʽµ«ÊDz»·µ»ØÖµ¡£
void ²Ù×÷·ûÓ÷¨¸ñʽÈçÏ£º
1. javascript:void (expres ......

ie6ÖÐhrefÉèΪjavascript:void(0)Ò³ÃæÎÞ·¨Ìá½»

<a class="bt_3" href="javascript:void(0)" mce_href="javascript:void(0)" id="btnSubmit1" onclick="submitPage()">Ìá½»</a>
submitPage() ÊÇÎÒ¶¨ÒåµÄÒ»¸öº¯Êý£¬Ô­ÒâÊǵã»÷Õâ¸ö<a>ʱ£¬Ìá½»Ò»¸ö±íµ¥¡£ft, ie6 ¾ÓÈ»²»¿ÉÒÔ£¬ÔõôҲ²»ÄÜÌá½»¡£
¿´À´ÊÇÒòΪ ie6 Ö´ÐÐĬÈ϶¯×÷ÒýÆðÀ´£¬Ä¿Ç°Á½ÖÖ½â¾ö·½·¨£ ......

[JAVASCRIPT] this ¶ÔÏó

¿´Á˺ܶàjavascrip´úÂ룬·¢ÏÖºÜ¶àµØ·½Óõ½ÁËthisÕâ¸ö¶ÔÏó£¬ÄÇÕâ¸öµ½µ×ÊÇʲô¶«Î÷°¢£¿
ÏÈÈÃÎÒÃÇÀ´Àí½âÒ»¸ö¸ÅÄ
ÔÚjavascript»áÓÐÒ»¸öÉÏÏÂÎĵĸÅÄÈκÎÒ»¸ö¶ÔÏóÎÞÂÛÊÇObject »¹ÊÇfunction ¶¼»áÓÐÒ»¸öרÓеÄÉÏÏÂÎĶÔÏó£¬Ò²¿ÉÒÔÀí½âΪËü×Ô¼ºµÄÓµÓÐÕß¡£
ÄÇôÎÒÃǺÜÈÝÒ×Ïëµ½Õâ¸öÓµÓÐÕߣ¬±ØÈ»ÓиöÖյ㣬ÄǾÍÊÇwindow¶ÔÏó¡£ ......

JavaScriptÖеĿÕÀàÐÍ

×ªÔØÀíÓÉ£º¶ÌС¾«º·¡£
À´Ô´£º»¥ÁªÍø
Ò» Undefined ÀàÐÍ
Ö»ÓÐÒ»ÖÖÖµ undefined
ÒÔÏÂÈýÖÖÇé¿ötypeof ·µ»ØÀàÐÍΪundefined
1. µ±±äÁ¿Î´³õʼ»¯Ê±
2. ±äÁ¿Î´¶¨Òåʱ
3. º¯ÊýÎÞÃ÷È··µ»ØÖµÊ±£¨º¯ÊýûÓзµ»ØÖµÊ±·µ»ØµÄ¶¼ÊÇundefined£©
undefined ²¢²»µÈͬÓÚ䶨ÒåµÄÖµ
typeof ²¢²»ÕæÕýÇø·ÖÊÇ·ñÊÇ䶨Òå
¿´ÒÔÏÂʾÀý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ