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
Ïà¹ØÎĵµ£º
Ò»¡¢Ê²Ã´ÊÇ¿ò¼Ü
¡¡¡¡¿ò¼ÜFrames×îÖ÷Òª¹¦ÓÃÊÇ"·Ö¸î"ÊÓ´°£¬Ê¹Ã¿¸ö"СÊÓ´°"ÄÜ
ÏÔʾ²»Í¬µÄHTM
LÎļþ£¬²»Í¬¿ò¼ÜÖ®¼ä¿ÉÒÔ»¥¶¯(interact)£¬Õâ¾ÍÊÇ˵²»Í¬¿ò¼ÜÖ®¼ä¿ÉÒÔ½»»»Ñ¶Ï¢Óë×ÊÁÏ¡£ÀýÈç:¼ÙÉèÄú¿ªÁËÁ½¸öframes£¬µÚÒ»¸öframe¿ÉÏÔ
ʾÊéµÄĿ¼£¬µÚ¶þ¸öframeÔòÏÔʾÕ½ڵľßÌåÄÚÈÝ¡£
¡¡¡¡¿ò¼Ü¿ÉÒÔ½«ÆÁÄ»·Ö¸î ......
/***************************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³ ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charse ......
//УÑéÊÇ·ñÈ«ÓÉÊý×Ö×é³É
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéµÇ¼Ãû£ºÖ»ÄÜÊäÈë5-20¸öÒÔ×Öĸ¿ªÍ·¡¢¿É´øÊý×Ö¡¢“_”¡¢“.”µÄ×Ö´®
function isRegisterUserName(s)
{
v ......