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

³£¼ûfirefox²»Ö§³ÖµÄJavaScriptÎÊÌâ

<a href="#" onclick="ChildNode(this);">aaa</a>Òª¸ÄΪ
<a href="#" onclick="ChildNode(event);">aaa</a>
ÎÞ·¨È¡µÃthis¶ÔÏó£¬ÒªÓÃÒÔÏ·½·¨À´È¡µÃ¡£
function ChildNode(e)
{
var evt = e ? e : (window.event ? window.event : null); //´Ë·½·¨ÎªÁËÔÚfirefoxÖеļæÈÝ
var node = evt.srcElement ? evt.srcElement : evt.target; //evt.targetÔÚ»ðºüÉϲÅÄÜʶ±ðÓõġ£
selectNode = node.getAttribute("nodeId").toString();
}
nodeIdÊôÐÔ²»Ö§³Ö£¬Òªnode.getAttribute("nodeId");
»¹ÓÐvar+=elements[i].innerTextÔÚfirefoxÖÐÎÞʶ±ð£¬ÓÃelements[i].innerHTMLÀ´Ö§³Ö¼´¿É¡£
------------------------------------------------------------------------------------------------
//ÕâÊÇÒ»¸ö·ÃÎÊÏÂÀ­¿òµÄ·½·¨£¬×¢Òâele.option()£»ÖеÄÔ²À¨ºÅfirefox²»Ö§³Ö£¬Ö»ÄÜÓÃ[];²ÅÐС£
var ele = document.getElementById('bizName');
idv = ele.option[ele.selectedIndex].title;
---------------------------------------------------------------------------
//ÔÚ»ðºüÖеĵØÖ·À¸ÊäÈ룺about:config£¬»á³öÏÖ»ðºüµÄ²ÎÊýÅäÖÃÉèÖã¬
---------------------------------------------------------------------------------
document.allÔÚ»ðºüÖÐÎÞ·¨±»Ê¶±ð£¬ÓÃdocument.getElementById,document.getElementByNameµÈÀ´Ìæ»»¼´¿É¡£
----------------------------------------------------------------------------------------
//Îļþä¯ÀÀµÄÎı¾ÄÚÈÝÇåÀí·½·¨£»unselectalbe£ºÓÃÓÚÉèÖÃÖ»¶ÁÊôÐÔ¡£on/off£ºÁ½¸öÖµ¡£
<input type="file" name="pic" id="pic" onchange="checkpic(this);" UNSELECTABLE="on"/>
function checkpic(here)
{
var reg_pic=/\w+(\.gif|\.jpg){1}/;
if(!reg_pic.test(here.value))
{
alert("");
here.outerHTML += "";//ÓÃÓÚÇå³ýä¯ÀÀ¿òÖеÄÄÚÈÝ,here.value="";ÊÇÎÞ·¨Ö´Ðеġ£IEÖ§³ÖÕâ¸ö·½·¨
here.value = ""; //IE²»Ö§³ÖÕâ¸öÊôÐÔ£¬fireforÈ´Ö§³Ö¡£
//ÔÚ¸³ÖµÊ±Òª×¢ÒâouterHTML+=£¬valueÓÃ=¡£
return;
}
}
//ÓÃÀ´Çå³ýfileÖеÄÄÚÈÝ£»
<input type="file" id="file1"/><input type="button" onclick="addfile();"/>
function addfile(){
document.all('file1').select();
document.selection.clear()
}
----------------------------------------------------
//ÓÃÀ´


Ïà¹ØÎĵµ£º

JavaScript Array ¿ÉÒÔÀ©Õ¹µÄ¼¸¸ö·½·¨

     indexOf
·µ»ØÔªËØÔÚÊý×éµÄË÷Òý£¬Ã»ÓÐÔò·µ»Ø-1¡£ÓëstringµÄindexOf·½·¨²î²»¶à¡£
Èç¹ûÆäËûä¯ÀÀÆ÷ûÓÐʵÏÖ´Ë·½·¨£¬¿ÉÒÔÓÃÒÔÏ´úÂëʵÏÖ¼æÈÝ£º
Array.prototype.indexOf = function(el, start) {
var start = start || 0;
for ( var i=0; i < this.length; ++i ) {
......

JavaScriptµÄÀàÐÍת»»(×Ö·ûתÊý×Ö£¬Êý×Öת×Ö·û)

ÔÚJavaÖУ¬»ù±¾ÀàÐÍÖ®¼äµÄÇ¿ÖÆת»»Ò²²»ÊÇÕâÑùµÄ£¬±ÈÈ磬ÕûÊýҪת»»³É×Ö·û´®£¬±ØÐëʹÓÃInteger.toString()¾²Ì¬·½·¨»òÕßString.valueOf()¾²Ì¬·½·¨£¬°Ñ×Ö·û´®×ª»»ÎªÕûÊý£¬±ØÐëʹÓÃInteger.valueOf()¡£
¿É¼û£¬²»ÄÜ°ÑJavaScriptÖеÄÀàÐÍת»»¿´×÷Ϊ“Ç¿ÖÆÀàÐÍת»»”¡£
ÔÚJavaScriptÖУ¬DoubleÀàÐͺÍIntÀàÐͶ¼ÊÇ¿´×÷Ϊ ......

ÉîÈëÀí½âJavascript±Õ°ü

ÉîÈëÀí½âJavascript±Õ°ü
 ×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊDZհü£¿
¡¡¡¡“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü ......

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

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

¶àä¯ÀÀÆ÷¼æÈÝÐÔÎÊÌâ¼°½â¾ö·½°¸Ö®Javascriptƪ

 
ʱ¼ä: 2009-9-02 - ·ÖÀà: Html+CSS, JavaScript - ÆÀÂÛ: 0 - ÔĶÁ: 70 ´Î
CSS¸úJavaScript¿ª·¢ÖУ¬×îÁî´ó¼ÒÍ·ÌÛµÄÎÊÌâ¾ÍÊÇä¯ÀÀÆ÷¼æÈÝÐÔÁË£¬ËäÈ»ºÜ¶àÎÄÕÂÓÐÕâ·½ÃæµÄÎÄÕ£¬µ«ÒÀÈ»Èúܶ࿪·¢ÈËÔ±ÔÎͷתÏò£¬¶øÇÒÒ²²»¹»È«Ãæ¡£ÕâƪÎÄÕ£¬½«È«ÃæÊÕ¼¯cssºÍjavascriptÔÚ¸÷ÖÖä¯ÀÀÆ÷ϵļæÈÝÐÔ±¨¸æ£¬Ò²ÆÚ´ý¸÷λ²»¶Ï²¹³ä¡£
Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ