javascriptÖм¸ÖÖ²Ù×÷´òÓ¡µÄ·½·¨
1¡¡¾Ö²¿´òÓ¡·½·¨£º
×÷Ó㺽«idΪdayinµÄÄÚÈÝ£¬Ð½¨Ò³Ãæ²¢´òÓ¡£¬¿É½â¾ö´òӡijҳÃæÖеIJ¿·ÖÄÚÈݵÄÎÊÌâ¡£
ʹÓ÷½·¨£º½«Òª´òÓ¡µÄÄÚÈÝͨ¹ý <span id="dayin"></span>°üº¬ÆðÀ´£¬È»ºóÔÚij¸ö°´Å¤Öж¨Òå
ʼþ
<input type="button" onclick="dayin()" value="´òÓ¡">
function dayin()
{
var code="<body onload=window.print()>"
code+=document.all.dayin.innerHTML;
code=code.toUpperCase();
code=code.replace(/<A[^>]*>ɾ³ý<\/A>/gi, "");
code=code.toLowerCase();
var newwin=window.open('','','');
newwin.opener = null;
newwin.document.write(code);
newwin.document.close();
}
ÆäÖÐcode=code.replace(/<A[^>]*>ɾ³ý<\/A>/gi, "");
2¡¡ÀûÓÃCSSʵÏÖ¾Ö²¿´òÓ¡
½éÉÜÁ½¸ö¹Ø¼üµÄCSS
<style media="print">
.Noprint { DISPLAY: none }
.PageNext{ PAGE-BREAK-AFTER: always }
</style>µÚÒ»¸öÔÚ²»ÐèÒª´òÓ¡µÄ±êÇ©ÉÏÌí¼Ó£¨×Ó±êÇ©Ò²½«²»±»´òÓ¡£©£¬µÚ¶þ¸öÔÚÐèÒª»»ÐеıêÇ©´¦Ìí¼Ó£¨¸Ã±êÇ©Ëù±íʾµÄÄÚÈݽ«ÔÚµ±Ç°´òÓ¡µÄÒ»Ò³ÄÚ£©
½ÓÏÂÀ´Í¨¹ýµ÷ÓÃ×î»ù±¾µÄjsÓï¾ä
window.print()¾Í¿ÉʵÏÖÒ³Ãæ¾Ö²¿´òÓ¡ÁË£¬ºÜeasy°É£¡
3¡¡´òÓ¡Ô¤ÀÀ
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
height=0 id=wb name=wb width=3></OBJECT>
<input class="ipt" type=button name= button _print value="´òÓ¡"
onclick =" javascript :printit();">
<input class="ipt" type=button name=button _setup value="´òÓ¡Ò³ÃæÉèÖÃ"
onclick =" javascript : printsetup();">
<input class="ipt" type=button name=button_show value="´òÓ¡Ô¤ÀÀ" &
Ïà¹ØÎĵµ£º
eclipseÖÐjavascriptÏÔʾΪÂÒÂëµÄ½â¾ö°ì·¨¡£
Òà¿ÉÒÀ´ÎÑ¡Ôñ²Ëµ¥"window">>"preferences">>"general">>"content types"
ÔÚÓұߵĴ°¿ÚÖдò¿ªÁбí,Ñ¡ÖÐ"JavaScript",ÔÚÏÂÃæµÄ"default encoding"ÓұߵÄÊäÈë¿òÖÐÊäÈëjavaScript±àÂ룬Ҫ¿´ÄúµÄÍøÒ³ÓõıàÂ룬Èç¹ûÊÇ“GBK”¾ÍÑ¡"GBK",ÊÇ"GB2312"¾ ......
¾¡¹Ü JavaScript ÀúÊ·ÉÏʹÓÃÈß³¤¶øÁîÈËÉúÑáµÄ´úÂë¿éÀ´±êµÄÌض¨ä¯ÀÀÆ÷µÄʱÆÚÒѾ½áÊøÁË£¬µ«ÊÇż¶ûʹÓÃһЩ¼òµ¥µÄ´úÂë¿éºÍ¶ÔÏó¼ì²âÀ´È·±£Ò»Ð©´úÂëÔÚÓû§»úÆ÷ÉÏÕý³£¹¤×÷ÒÀÈ»ÊDZØÒªµÄ¡£
ÕâƪÎÄÕÂÖУ¬ÎÒ»áÂÔÊöһϠInternet Explorer ºÍ Firefox ÔÚ JavaScript Óï·¨Éϲ»Í¬µÄ 7 ¸ö·½Ãæ¡£
1. CSS “float” ÊôÐÔ
Ȗ ......
javascriptÌṩÁËÐí¶àº¯Êý¹©¿ª·¢ÈËԱʹÓã¬ÏÂÃæ¸ø³öÒ»¸ö¼òµ¥½éÉÜ£¬¸üÏêϸµÄÐÅÏ¢Çë²Î¿¼Visual InterDevÌṩµÄÔÚÏß°ïÖú¡£
¡¡¡¡javascriptº¯ÊýÒ»¹²¿É·ÖΪÎåÀࣺ
¡¡¡¡·³£¹æº¯Êý
¡¡¡¡·Êý×麯Êý
¡¡¡¡·ÈÕÆÚº¯Êý
¡¡¡¡·Êýѧº¯Êý
¡¡¡¡·×Ö·û´®º¯Êý
¡¡¡¡1.³£¹æº¯Êý
¡¡¡¡javascript³ ......
//ÎÞģʽµÄÌáʾ¿ò
//ÆÁ±Î°´¼ü
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript>
<title>ÆÁ±ÎÊó±êÓ ......
javascriptʼþÁбí½â˵
ʼþ ä¯ÀÀÆ÷Ö§³Ö ½â˵
Ò»°ãʼþ onclick IE3¡¢N2 Êó±êµã»÷ʱ´¥·¢´Ëʼþ
ondblclick IE4¡¢N4 Êó±êË«»÷ʱ´¥·¢´Ëʼþ
onmousedown IE4¡¢N4 °´ÏÂÊó±êʱ´¥·¢´Ëʼþ
onmouseup IE4¡¢N4 Êó±ê°´ÏºóËÉ¿ªÊó±êʱ´¥·¢´Ëʼþ
onmouseover IE3¡¢N2 µ±Êó±êÒƶ¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢´Ëʼþ
onmou ......