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

javascript »ñÈ¡¹ö¶¯Ìõ¸ß¶È+³£ÓÃjsÒ³Ãæ¿í¶ÈÓë¸ß¶È

/********************
 * È¡´°¿Ú¹ö¶¯Ìõ¸ß¶È 
 ******************/
function getScrollTop()
{
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop)
    {
        scrollTop=document.documentElement.scrollTop;
    }
    else if(document.body)
    {
        scrollTop=document.body.scrollTop;
    }
    return scrollTop;
}
/********************
 * È¡´°¿Ú¿ÉÊÓ·¶Î§µÄ¸ß¶È 
 *******************/
function getClientHeight()
{
    var clientHeight=0;
    if(document.body.clientHeight&&document.documentElement.clientHeight)
    {
        var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;        
    }
    else
    {
        var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;    
    }
    return clientHeight;
}
/********************
 * È¡ÎĵµÄÚÈÝʵ¼Ê¸ß¶È 
 *******************/
function getScrollHeight()
{
    return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}
////////////////////////////////////////////////////
ÔÚIEÖУº
document.body.clientWidth ==> BODY¶ÔÏó¿í¶È
document.body.clientHeight ==> BODY¶ÔÏó¸ß¶È
document.documentElement.clientWidth ==> ¿É¼ûÇøÓò¿í¶È
document.documentElement.clientHeight ==> ¿É¼ûÇøÓò¸ß¶È
ÔÚFireFoxÖУº
document.body.clientWidth ==> BODY¶ÔÏó¿í¶È
d


Ïà¹ØÎĵµ£º

selectÔªËØjavascript³£ÓòÙ×÷


*------------------------------------------------------  
 *˵Ã÷£ºselectÔªËØjavascript³£ÓòÙ×÷  
 * 1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem  
 * 2.¼ÓÈëÒ»¸öItem  
 * 3.ɾ³ýֵΪvalueµÄËùÓÐItem  
 * 4.ɾ³ýijһ¸öindexµÄÑ¡Ïî  
  ......

Java°æµÄʵÏÖJavaScriptÖеÄeval()º¯Êý

ʵÏÖ²½Ö裺
1.×Ô¶¨ÒåÒ»¸öJavaÀ࣬¸ÃJavaÀàÖж¨ÒåÒ»¸ö·½·¨À´°üº¬ÐèÒª±»ÔËÐеĴúÂë¡£
2.¶¯Ì¬±àÒë¸Õ¸ÕÉú³ÉµÄJavaÔ´Â룬²»ÔÚ´ÅÅÌÉÏÉú³ÉÔ´Â룬¶øÊÇÖ±½Ó±àÒëÄÚ´æÖеÄJavaÔ´Âë¡£
3.¶¯Ì¬¼ÓÔظոմ´½¨±àÒëµÄJava¶þ½øÖÆÂ룬±àÒëºÃµÄJava¶þ½øÖÆÂë²»ÊÇÔÚ´ÅÅÌÉÏ£¬¶øÊÇ·ÅÔÚÄÚ´æÖУ¬²¢¶¨Òå×Ô¼ºµÄÀà¼ÓÔØÆ÷£¬¸ºÔð¼ÓÔØÄÚ´æÖеÄclassÎļþ¡£ ......

JavaScriptÖÐthis¹Ø¼ü×ÖʹÓ÷½·¨Ïê½â

ÔÚÃæÏò¶ÔÏó±à³ÌÓïÑÔÖУ¬¶ÔÓÚthis¹Ø¼ü×ÖÎÒÃÇÊǷdz£ÊìϤµÄ¡£±ÈÈçC++¡¢C#ºÍJavaµÈ¶¼ÌṩÁËÕâ¸ö¹Ø¼ü×Ö£¬ËäÈ»ÔÚ¿ªÊ¼Ñ§Ï°µÄʱºò¾õµÃ±È½ÏÄÑ£¬µ«Ö»ÒªÀí½âÁË£¬ÓÃÆðÀ´ÊǷdz£·½±ãºÍÒâÒåÈ·¶¨µÄ¡£JavaScriptÒ²ÌṩÁËÕâ¸öthis¹Ø¼ü×Ö£¬²»¹ýÓÃÆðÀ´¾Í±È¾­µäOOÓïÑÔÖÐÒª"»ìÂÒ"µÄ¶àÁË¡£
ÏÂÃæ¾ÍÀ´¿´¿´£¬ÔÚJavaScriptÖи÷ÖÖthisµÄʹÓ÷½·¨ÓÐʲô ......

ÓÃJavascriptʵÏÖ¾²Ì¬¶ÔÏó¡¢¾²Ì¬·½·¨ºÍ¾²Ì¬ÊôÐÔ

JavascriptÓïÑÔµÄÃæÏò¶ÔÏóÌØÕ÷ºÜÈõ£¬ÆäËûÃæÏò¶ÔÏóÓïÑÔÔÚ´´½¨ÀàʱֻҪʹÓùؼü×Östatic¼´¿ÉÖ¸¶¨ÀàΪ¾²Ì¬À࣬JavascriptûÓÐÌṩstaticÕâÑùµÄ¹Ø¼ü×Ö£¬ÒªÈÃJavascriptÒ²¾ßÓГ¾²Ì¬”ÌØÐÔÖ»Óп¿Ò»Ð©“Ææ¼¼ÒùÇÉ”ÁË¡£
´úÂëÖÐÁоÙÁËÁ½ÖÖ¾²Ì¬·½·¨/ÊôÐÔµÄʵÏÖ·½Ê½£¬Ò»ÖÖÊǾ²Ì¬ÀàµÄ¾²Ì¬·½·¨ºÍÊôÐÔ£¬ÁíÒ»ÖÖÊǷǾ ......

javascript»ù´¡

ÿһÏÊÇjsÖеÄС¼¼ÇÉ£¬µ«Ê®·ÖµÄʵÓã¡
1.document.write(""); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window->(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËصÄÃû³ÆºÍÖµ:document.getElementById("±íµ¥ÖÐÔªËØµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ