javascript °ü¹ü½Úµã
Ä£·ÂjQuey£¬´´½¨¼¸¸ö°ü¹ü½ÚµãµÄ·½·¨£¬·¢ÏÖjQueryµÄ·½·¨ºÜµÍЧ°¡£¬ÏÂÒ»´ÎËûÓÖ¿ÉÒÔ˵Õ⼸¸ö·½·¨¿ÉÒÔÌáÉýÁ˶àÉÙ¶àÉÙÁË¡£ÔÀí»ù±¾ÊÇÕâÑù£¬Èç¹û´«ÈëµÄÊÇ×Ö·û´®£¬ÄÇôÈÃËüÃDZä³ÉÒ»¸öÔªËØ½Úµã£¬²»¹ýÕâÔªËØ½ÚµãÒ²¿ÉÒÔÓÐÐí¶à²ã£¬ÔÚ×îÄÚ²ã°ÑÒª°ü¹üµÄÔªËØ·Å½ø¡£°Ñ×Ö·û´®±ä³ÉÔªËØ½ÚµãµÄ·½·¨ÓÐÈçϼ¸¸ö¡£1£¬createElement£¬IE¿ÉÒÔÁ¬ÔªËØÊôÐÔÒ²Ò»Æð´´½¨£¬µ«Ö»ÄÜ´´½¨Ò»²ã¡£2£¬innerHTML£¬²»¹ýÐèÒª¶ÔÔÀ´µÄ×Ö·û´®½øÐд¦Àí£¬IEÓëFF¶¼ÓÐÐí¶àÒâÏë²»µ½µÄĬÈÏÐÐΪ£¬¿ÉÒÔΪÄã¶à¼ÓÒ»µã¶«Î÷»òÉÙ¼ÓÒ»µã¶«Î÷¡£3£¬createContextualFragment£¬ÓÉÓÚOperaµÄÐÐΪÓеã¹ÖÒ죬ÐèҪѡÖÐÐÞ¸ÄÔªËØµÄλÖ᣾ÈÕ±¾È˵IJâÊÔ£¬Ëüת»»×Ö·û´®³É½ÚµãµÄЧÂʱÈinnerHTML¸ß¶àÁË£¬Ò²°²È«¶àÁË£¬ÕæÊÇÇ¿ÕßÓúÇ¿£¬ÈõÕßÓúÈõ¡£Èç¹ûÊÇ´«ÈëÔªËØ½Úµã£¬ÐèÒª¿Ë¡һÏ£¬Òª²»¶¼±ä³ÉwrapAll¡£Èç¹ûÊǺ¯Êý£¬°Ñµ±Ç°ÔªËØ´«½øÈ¥£¬ÀûÓÃËüµÄijЩÊôÐÔ´´½¨Ò»¸ö°ü¹üÔªËØ¡£
×î³õµÄʵÑ鯷£¨ÕâÀïµÄwrapOuterÏ൱ÓÚjQueryµÄwrap£©£º
var parseHTML = function(str) {
if(document.createRange){
var range = document.createRange()
range.setStartAfter(document.body)
return range.createContextualFragment(str)
}else{
return document.createElement(str)
}
}
var wrapOuter = function(target,html){
var wrap = parseHTML(html) ;
target.parentNode.insertBefore(wrap,target);
target.previousSibling.appendChild(target)
}
<!doctype html>
<html dir="ltr" lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta content="IE=8" http-equiv="X-UA-Compatible"/>
<style type="text/css">
.wrapper {
margin: 5px 5px 5px 5px;
padding: 5px 5px 5px 5px;
background-color:#dfe8f6;
border: 1px solid magenta;
}
.inner{
margin:1em;
height:20px;
background:#a9ea00
}
.border{
border:2px solid red;
}
</style>
<title>°ü¹ü½Úµã by ˾ͽÕýÃÀ</title>
<script type="text/javascript">
window.onload = func
Ïà¹ØÎĵµ£º
JavaScript½Å±¾ÓïÑԵĻù±¾¹¹³ÉÊÇÓÉ¿ØÖÆÓï¾ä¡¢º¯Êý¡¢¶ÔÏó¡¢·½·¨¡¢ÊôÐÔµÈ,À´ÊµÏÖ±à³ÌµÄ¡£
Ò»¡¢
³ÌÐò¿ØÖÆÁ÷
¡¡¡¡ÔÚÈκÎÒ»ÖÖÓïÑÔÖУ¬³ÌÐò¿ØÖÆÁ÷ÊDZØÐëµÄ£¬ËüÄÜʹµÃÕû¸ö³ÌÐò¼õС»ìÂÒ£¬Ê¹Ö®Ë³Àû°´ÆäÒ»¶¨µÄ·½Ê½Ö´ÐС£ÏÂÃæÊÇ
JavaScript³£ÓõijÌÐò¿ØÖÆÁ÷½á¹¹¼°Óï¾ä:
£±¡¢ifÌõ¼þÓï¾ä
¡¡»ù±¾
¸ñʽ
if£¨±íÊöʽ£©
Óï¾ä¶Î£±£»
......
/***************************by
garcon1986********************************/
Java is to
JavaScript what Car is to Carpet
ÂÛ̳½»Á÷£º´óÐ͵Äweb¿ª·¢ÉçÇø
http://www.webdeveloper.com/forum/index.php
W3CschoolsÖÐÎÄÕ¾£º¿ª·¢ÕßµÄʵÓÃ+Ñ§Ï°ÍøÕ¾
http://www.w3school.com.cn/js/index.asp
javascript³ ......
//×Ô´øµÄ´òÓ¡Ô¤ÀÀ WebBrowser.ExecWB(1,1) ´ò¿ª
Web.ExecWB(2,1) ¹Ø±ÕÏÖÔÚËùÓеÄIE´°¿Ú£¬²¢´ò¿ªÒ»¸öд°¿Ú
Web.ExecWB(4,1) ±£´æÍøÒ³
Web.ExecWB(6,1) ´òÓ¡
Web.ExecWB(7,1) ´òÓ¡Ô¤ÀÀ
Web.ExecWB(8,1) ´òÓ¡Ò³ÃæÉèÖÃ
Web.ExecWB(10,1) ²é¿´Ò ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type ²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture(); ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey ʼþ·µ»ØÖµ
event.returnValue Êó±êλÖÃ
event.x
event.y ´°Ìå ......