Javascript»ñµÃ×ÓÒ³Ãæ±äÁ¿µÄÖµ
Àý£º
page.htmlÒ³Ãæ£º
<html>
<head>
<title>This is a test</title>
</head>
<script type="text/javascript">
var count;
</script>
<body>
<iframe id="child" src="childPage.html" src="childPage"></iframe>
</body>
</html>
Ò³ÃæÀïǶÌ×ÁËÒ»¸öchildPage.htmlÒ³Ãæ¡£
ÔÚpageÖеÄcountÈçºÎ»ñµÃchildPageÒ³ÃæµÄchildCountֵĨ£¿
child.childCountÕâÖÖ·½·¨Ã²ËƲ»ÐÐ……
»¹ÊÇ»»Ò»ÖÖ˼·°É£¬ÈÃchildPageÖеÄchildCountµÈÓÚpageÒ³ÃæµÄcount¡£ÈçÏ£º
<html>
<head>
<title>This is a test(child)</title>
</head>
<script type="text/javascript">
var childCount = parent.count;
<script>
<body>
<iframe id="child" src="childPage" src="childPage"></iframe>
</body>
</html>
ÕâÑùÔÚpageÒ³ÃæÖ±½Ó¾Í¿ÉÒÔ»ñµÃchildPageÒ³ÃæµÄchildCountµÄÖµ¡£
Ïà¹ØÎĵµ£º
Ö»ÄÜÊäÈëÊý×Ö£º"^[0-9]*$"
Ö»ÄÜÊäÈë n λµÄÊý×Ö£º"^\d{n}$"
Ö»ÄÜÊäÈëÖÁÉÙ n λµÄÊý×Ö£º"^\d{n,}$"
Ö»ÄÜÊäÈë m ¡« n λµÄÊý×Ö£º"^\d{m,n}$"
Ö»ÄÜÊäÈëÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º"^(0|[1-9][0-9]*)$"
Ö»ÄÜÊäÈëÓÐÁ½Î»Ð¡ÊýµÄÕýʵÊý£º"^[0-9]+(.[0-9]{2})?$"
Ö»ÄÜÊ ......
HtmlÒ³
<a href="javascript:void(0);" ><img id="SubmitFeedback" src="/images/comment_btn.gif" /></a>
½Å±¾
$(document).ready(function() {
alert("Ò³ÃæË¢ÐÂ");
$("#SubmitFeedback").bind("click", Test);
});
functi ......
JavaScriptÔËÐдúÂë¿ò´úÂë
<script language="JavaScript" type="text/JavaScript">
//ÔËÐÐÎı¾Óò´úÂë
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value;
if (code!=""){
var newwin=window.open(’’,’’,’’); //´ò¿ªÒ»¸ö´°¿Ú²¢¸³¸ø±äÁ¿newwin¡£ ......
1.ÏÈ»ñµÃselect£º
var s = document.getElementById("selectYear");
2.¿ÉÒÔÏÈÒÆ³ýÉÏ´ÎÌí¼ÓµÄoption£¨ÕâÀïҪעÒ⣬ÿ´Îɾ³ýµÄ¶¼ÊǵÚÒ»¸öÔªËØ£¬ÒòΪɾһ¸öÉÙÒ»¸ö£©£º
var l = s.options.length;
for(var i=0;i<l;i++){
s.options.remove(0);
}
3.Ìí¼ÓÐÂÔªËØ£¨iÊÇ×Ô¼º¶¨ÒåµÄ£¬¸ù¾Ý× ......
1¡¢ÎÞÌáʾ¹Ø±Õ´°¿Ú
<input type="button" onClick="window.opener = '';window.close();" value="IE6×î¼òµ¥µÄÎÞÌáʾ¹Ø±Õ´°¿Ú" >
2¡¢·ÀÖ¹±»ÈËiframe
if (top.location != self.location)
{
top.location.href="http://www.34do.net";
}
3¡¢ÅжÏÒ»¸ö¶ÔÏó´æÔÚ²»´æÔÚ
document.all("a")==null£¨²»´æÔÚ£©
......