JavascriptÍøÒ³´òÓ¡´óÈ«
Ò»¡¢ÆÕͨ´òÓ¡£¨ÕûÒ³´ò£©
¶þ¡¢´òÓ¡ÍøÒ³ÄÚ²¿·ÖÄÚÈÝ£¨×Ô¶¨Ò壩
Èý¡¢´òÓ¡È¥µô/Ìí¼Óҳüҳ½Å
ËÄ¡¢Ê¹ÓÃÍⲿ¿Ø¼þ/·½·¨ÊµÏֶ๦ÄÜ´òÓ¡
Îå¡¢´òÓ¡±³¾°
(ÒÔÉÏΪ´úÂë¿ØÖÆ)
Áù¡¢ÉèÖÓҳÃæÉèÖÔʵÏÖ´òÓ¡²ÎÊýÉèÖã¨WindowϵͳͼÎİ棩
Ò»¡¢ÆÕͨ´òÓ¡£¨ÕûÒ³´ò£©
Õâ¸ö²»Óöà˵£¬Ö±½ÓÓÃ
ÒýÓÃ:window.print();
¶þ¡¢´òÓ¡ÍøÒ³ÄÚ²¿·ÖÄÚÈÝ£¨×Ô¶¨Ò壩
·ÖÈýÖÖ·½·¨ÊµÏÖ£º
1¡¢ÓÃcss¿ØÖÆ
ÒýÓÃ:@media print
.a {display:block}
.b {display:hidden}
°ÑÄã²»Ïë´òÓ¡µÄ²¿·ÖclassÉèΪb
Ê×ÏÈÔÚÍøÒ³ÖÐÌí¼Ó£º
ÒýÓÃ:<OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
VIEWASTEXT>
</OBJECT>
È»ºó¾Í¿ÉÒÔÒÀ´Î¼ÓÈ빦ÄÜ°´Å¥ÁË£º
ÒýÓÃ:<input type="button" value="´òÓ¡"> <input type="button" value="Ö±½Ó´òÓ¡">
<input type="button" value="Ò³ÃæÉèÖÃ">
<input type="button" value="´òÓ¡Ô¤ÀÀ"> <INPUT type="button" value="¹Ø±Õ´°¿Ú" >
½«ÕâÁ½¿é¶«Î÷·Åµ½<center class=noprint></center>¾Í²»»á´òÓ¡ÕâЩ°´Å¥ÁË¡£µ±È»Òª¶¨ÒånoprintÁË£º
<style media="print">.Noprint { DISPLAY: none }</style>Ö»Òª°Ñ²»Ïë´òÓ¡µÄ¶«Î÷µÄcssÉèÖóÉnoprint¾Í¿ÉÒÔÁË¡£
ÏÖÔÚ¾ÍʵÏÖÁË»ù±¾µÄweb´òÓ¡£¬ÐèҪעÒâµÄÇé¿öÈçÏ£º
a. ±ØÐ뽫ieµÄinternetÑ¡ÏîµÄ°²È«ÉèÖÃÖжÔÓÚûÓбê¼ÇΪ°²È«µÄActiveX¿Ø¼þ½øÐÐ...ÉèÖóÉÌáʾ»òÕßÆôÓ㬷ñÔò»á±¨´í£¬µ¼Ö²»¿ÉÓá£
b. Èç¹ûÔÚvs.net±à¼»·¾³Ï±༸ÃÒ³Ã棬Ëü¾³£×Ô¶¯µÄ¸øobjectÌí¼Ó¶àÓàµÄ²ÎÊý£¬ÓÐÁËÕâЩ¶«Î÷£¬´òÓ¡¾Í»á³ö´í£¬ËùÒÔÒª¼ÇµÃ×îºó±£´æµÄʱºòɾ³ýËüÃÇ¡£
2¡¢ÓÃjavascript´òÓ¡¹Ì¶¨±êÇ©ÄÚµÄÄÚÈÝ
a¡¢ÔÚÒ³ÃæµÄ´úÂëÍ·²¿´¦¼ÓÈëJavaScript£º
ÒýÓÃ:<script language=javascript>
function doPrint() {
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window
Ïà¹ØÎĵµ£º
Õâ¶Îʱ¼ä̫æÁË£¬¶¼Ã»Ê±¼äÎÒ¹¤×÷ÐĵÃдÏÂÀ´ÁË£¬½ñÌì³é¸öʱ¼ä°ÑÇ°Á½Ì칤×÷ÖÐÅöµ½µÄһЩºÜ¼¬ÊÖµÄÎÊÌâÒÔ¼°½â¾öµÄ·½·¨£º
ÎÊÌâÃèÊö£º
embed±êÇ©½ÓÊܵ½Ö±²¥Á÷ÒÔºóÔÚIEÏ¿ÉÒÔͨ¹ýplay()ºÍpause()·½·¨µÃµ½ºÜºÃµÄ²¥·Å/ÔÝÍ£µÄ¿ØÖÆ£¬µ«ÔÚFireFoxºÍsafari È¥ÎÞÄÜΪÁ¦£¬ÔÚFirefoxºÍsafariÏ¿ÉÒÔÕý³£µÄ²¥·Å£¨ÔÚsafariÐèҪװmedia²å¼þ£©£ ......
ÔÚÍøÒ³Öж¯Ì¬ÔØÈëµÄ JavaScript ¶ÔÓÚÒ³ÃæÏÔʾµÄËÙ¶ÈÓ°ÏìÉõ¶à£¬²»µÃ²»×¢Ò⣡
ÓÈÆäÊǺܶàÈËÏ°¹ß°Ñ JavaScript include дÔÚ <head> Çø¿éÖУ¬ÕâÑùÒ»À´×î´óµÄÎÊÌâ¾ÍÊÇ Browser ±ØÐëÒªµÈµ½ JavaScript È«²¿¶ÁÍêºó²Å»á¿ªÊ¼ÏÔʾÍøÒ³£¬Èç¹ûÄãÏñÐÅÒå·¿ÎÝÕâÑù£¬¶ÁÒ»¸öÊ×Ò³ÒªÏÂÔØ 18 ¸ö JavaScript ÍⲿµµÇÒ¡¸Ã»ÓдóƵ¿í¡¹µÄ» ......
¶«Î÷ºÜ¼òµ¥£¬Ö»ÊÇ×Ô¼º¼ÇÐÔ²»ºÃ£¬¾³£Íü¼ÇһЩ¹Ø¼ü×Ö
ËùÒÔ·¢Á˵ãʱ¼äÕûÀíÁËÒ»ÏÂ
/*------------------------------------------------------
*×÷Õߣºxieyu @ 2007-08-14
*JavaScript
*˵Ã÷£ºselectÔªËØjavascript³£ÓòÙ×÷
* 1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem
* 2.¼ÓÈëÒ» ......
CDATA ÄÚ²¿µÄËùÓж«Î÷¶¼»á±»½âÎöÆ÷ºöÂÔ¡£
¼ÙÈçÎı¾Öаüº¬ÁË´óÁ¿µÄ "<" ºÍ "&" ×Ö·û - ¾ÍÏñ±à³Ì´úÂëÖо³£³öÏÖµÄÇé¿öÒ»Ñù - ÄÇôÕâ¸ö XML ÔªËؾͿÉÒÔ±»¶¨ÒåΪһ¸ö CDATA ²¿·Ö¡£
CDATA Çø¶Î¿ªÊ¼ÓÚ "<![CDATA["£¬½áÊøÓÚ "]]>"£º
<script type="text/javascri ......