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

javaScript»ñÈ¡Ò³Ãæ£¬ÆÁÄ»µÈ¸ß¶ÈÓë¿í¶È

//»ñÈ¡Ò³ÃæÊý¾Ý
 function getPageSize(){  
   var xScroll, yScroll;  
   if (window.innerHeight && window.scrollMaxY) {  
     xScroll = document.body.scrollWidth;
     yScroll = window.innerHeight + window.scrollMaxY;
   } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
     xScroll = document.body.scrollWidth;
     yScroll = document.body.scrollHeight;
   } else{ // Explorer Macwould also work in Explorer 6 Strict, Mozilla and Safari
     xScroll = document.body.offsetWidth;
     yScroll = document.body.offsetHeight;
   }
   var windowWidth, windowHeight;
   if (self.innerHeight) {  // all except Explorer
     windowWidth = self.innerWidth;
     windowHeight = self.innerHeight;
   } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
     windowWidth = document.documentElement.clientWidth;
     windowHeight = document.documentElement.clientHeight;
   } else if (document.body) { // other Explorers
     windowWidth = document.body.clientWidth;
     windowHeight = document.body.clientHeight;
   }  
   // for small pages with total height less then height of the viewport
   if(yScroll < windowHeight){
     pageHeight = windowHeight;
   } else { 
     pageHeight = yScroll;
   }
   if(xScroll < windowWidth){  
     pageWidth = windowWidth;
   } else {
    


Ïà¹ØÎĵµ£º

javaScriptÖеÄinnerText»ðºüä¯ÀÀÆ÷²»Ö§³Ö

ÕâÁ½ÌìµÄ¹¤×÷ÖÐÓöµ½Ò»¸öÓйØjsµÄÎÊÌ⣬ºÜÓôÃÆÓöµ½jsÎÊÌ⣬ÒòΪûÓб¨´í£¬Äã¸ù±¾¾Í²»ÖªµÀ×Ô¼º´íÔÚÄÄÀï¡£
Æäʵ¾ÍÊǹØÓÚ“document.getElementById("ss").innerText”µÄÎÊÌ⣬ÎÒÉÏÍø²é¹ØÓÚjsä¯ÀÀÆ÷µÄ¼æÈÝÎÊÌ⣬¿ÉÊǶ¼¸ø³öµÄ½âÊÍÊÇ£º
“HTML¶ÔÏó»ñÈ¡ÎÊÌâ
FireFox
£ºdocument
.getElementById
(& ......

Javascript ÔÚ HTML Ò³Ãæ¹â±ê´¦ÊäÈë×Ö·û

insertAtCurson º¯Êý´úÁ½²ÎÊý·Ö±ðΪ¶ÔÏóºÍÊäÈëµÄ×Ö·û
    function insertAtCursor(myField, myValue)
    { 
        if (document.selection)
        { 
         &nb ......

Javascript·ÃÎÊhtmlÒ³ÃæµÄ¿Ø¼þ

·ÃÎʿؼþµÄÖ÷Òª¶ÔÏóÊÇ:document¶ÔÏó¡£·Ö±ð¶ÔÓ¦µ±Ç°ÎĵµËùÓеģ¨×Ó¶ÔÏ󣩸öÈ˹۵㡣²¢ÇÒÒѾ­ÌṩµÄ¼¸¸öÖ÷Òª·½·¨À´·ÃÎʶÔÏó¡£
1.       document.getElementById
2.       document.getElementsByName
3        &n ......

JavaScript£ºprototypeÊôÐÔʹÓÃ˵Ã÷

prototype ÊÇÔÚ IE 4 ¼°ÆäÒÔºó°æ±¾ÒýÈëµÄÒ»¸öÕë¶ÔÓÚijһÀàµÄ¶ÔÏóµÄ·½·¨£¬¶øÇÒÌØÊâµÄµØ·½±ãÔÚÓÚ£ºËüÊÇÒ»¸ö¸øÀàµÄ¶ÔÏóÌí¼Ó·½·¨µÄ·½·¨£¡ÕâÒ»µã¿ÉÄÜÌýÆðÀ´»áÓеãÂÒ£¬±ð¼±£¬ÏÂÃæÎÒ±ãͨ¹ýʵÀý¶ÔÕâÒ»ÌØÊâµÄ·½·¨×÷ÒÑϽ²½â£º
¡¡¡¡Ê×ÏÈ£¬ÎÒÃÇÒªÏÈÁ˽âÒ»ÏÂÀàµÄ¸ÅÄJavaScript ±¾ÉíÊÇÒ»ÖÖÃæÏò¶ÔÏóµÄÓïÑÔ£¬ËüËùÉæ¼°µÄÔªËØ¸ù¾ÝÆäÊôÐÔµ ......

ѧϰ±Ê¼Ç JavaScript»ù´¡

JavaScript»ù´¡
stringObject.charAt(index)·½·¨£º·µ»ØÖ¸¶¨Ë÷ÒýλÖô¦µÄ×Ö·û¡£
stringObject.slice(start,[end])ºÍstringObject.substring(start,[end])·½·¨¶¼½ÓÊÜÁ½¸ö²ÎÊý£¬·Ö±ðΪ×Ó×Ö·û´®µÄÆðʼλÖúÍÖÕֹλÖ㬷µ»ØÕâÁ½ÕßÖ®¼äµÄ×Ö·û´®£¬²»°üÀ¨ÖÕֹλÖõÄÄǸö×Ö·û´®¡£Èç¹û²»Ö¸¶¨µÚ¶þ¸ö²ÎÊý£¬ÔòĬÈÏΪ×Ö·û´®µÄ³¤¶È£¬¼´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ