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

JavaScript TextBoxÊäÈëÊý×Ö¿ØÖÆ

var OnPasteCheckIntNum = function()
{
    if(window.clipboardData)
    {
        if(isNaN(window.clipboardData.getData('text')))
        {
            clipboardData.setData('text','');
        }
        else
        {
            //clipboardData.setData('text',clipboardData.getData('text'))
            clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
        }
    }
    else if(navigator.userAgent.indexOf("Opera") != -1)
    {
        if(isNaN(window.location))
        {
            //window.location = window.location.replace(/[^\d]/g,'');
            window.location = '';
        }
    }
};
var OnPasteCheckDecimal = function(id)
{   
    return function()
    {
        if(window.clipboardData)
        {
            if(isNaN(window.clipboardData.getData('text') + id.value))
            {
                clipboardData.setData('text','');
            }
     &n


Ïà¹ØÎĵµ£º

¶ÔJavaScriptµÄһЩÈÏʶ

¶ÔÓÚJavaScriptÀ´½²£¬ËüµÄ³öÏÖʹµÃÐÅÏ¢ºÍÓû§Ö®¼ä²»½öÖ»ÊÇÒ»ÖÖÏÔʾºÍä¯ÀÀµÄ¹ØÏµ£¬¶øÊÇʵÏÖÁËÒ»ÖÖʵʱµÄ¡¢¶¯Ì¬µÄ¡¢¿É½»Ê½µÄ±í´ïÄÜÁ¦¡£×î½üС±àÕûÀíÁËһЩ×ÊÁÏ£¬·¢²¼ÉÏÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¬Èç¹ûÎÄÕÂÓÐʲô覴û¹Ï£Íû¸ßÊÖÖ¸µã£¬´ó¼ÒÏ໥ѧϰ¡£
JavaScriptÊÇÒ»ÖÖ»ùÓÚ¶ÔÏó(Object)ºÍʼþÇý¶¯(Event Driven)²¢¾ßÓа²È«ÐÔÄܵĽű¾Óï ......

javascript event ʼþ½âÎö

 ÃèÊö event´ú±íʼþµÄ״̬£¬ÀýÈç´¥·¢event¶ÔÏóµÄÔªËØ¡¢Êó±êµÄλÖü°×´Ì¬¡¢°´ÏµļüµÈµÈ¡£ event¶ÔÏóÖ»ÔÚʼþ·¢ÉúµÄ¹ý³ÌÖвÅÓÐЧ¡£  eventµÄijЩÊôÐÔÖ»¶ÔÌØ¶¨µÄʼþÓÐÒâÒå¡£±ÈÈ磬fromElement ºÍ toElement ÊôÐÔÖ»¶Ô onmouseover ºÍ  onmouseout ʼþÓÐÒâÒå¡£ Àý×Ó ÏÂÃæµÄÀý×Ó¼ì²éÊó±êÊÇ·ñÔÚÁ´½ÓÉ ......

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......

javascriptÊ®½øÖÆ×ª¶þ½øÖÆ£¬¶þ½øÖÆ×ªÊ®½øÖÆ


alert(parseInt("101101", 2))

ÔËÐдúÂë

function toBin(intNum) {
var answer = "";
if(/\d+/.test(intNum)) {
while(intNum != 0) {
answer = Math.abs(intNum%2)+answer;
intNum = parseInt(intNum/2);
}
......

ÓÃJavaScriptÏÔʾ¹ã¸æÀ¸

 //¹ã¸æÀ¸
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// ×ó²à¹ã¸æ¾àÀëÒ³Ê׸߶È
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
e ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ