Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ×Ö·û´®´¦Àí


Ò»¡¢ÉùÃ÷×Ö·û´®:
var normal_monkey = "I am a monkey!<br>";
document.writeln("Normal monkey " + normal_monkey);
var bold_monkey = normal_monkey.bold();
document.writeln("Bold monkey "&n ......

JavaScriptÏÔʾʱ¼ä

Õâ¸öÎÊÌâºÜ¼òµ¥£¬Ö÷ÒªÓÐÏÂÃ漸¸ö֪ʶµã£º
£¨1£©       È¡µÃʱ¼ä£ºvar d=new Date();var time=d.toLocaleString()
£¨2£©       ÏÔʾÔÚÍøÒ³ÉÏ£¬¼ÙÉèдÔÚÒ»¸ö<span>ÖУ¬ÇÒ¸Ã<span>µÄidΪshowTime:
document.getElementById("showTime").innerHTML ......

JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«

JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [\u4E00-\uFA29]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^x00-xff]
ÆÀ×¢£º¿ÉÒÔÓÃÀ´¼ÆËã×Ö·û´®µÄ³¤¶È£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
Æ¥Åä¿Õ°×ÐеÄÕýÔò±í´ïʽ£ºns*r
ÆÀ×¢£º¿ÉÒÔÓÃÀ´É¾³ý¿Õ°×ÐÐ
......

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

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

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

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