JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2
ÔÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2-showModalDialog
ǰһƪÎÄÕÂJavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµÖн²µ½ÁËÈçºÎÀûÓÃwindow.open()·½·¨´ò¿ªÐ´°Ì壬²¢ÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµµÄ·½·¨¡£javascriptÖл¹ÓÐÒ»¸öº¯Êýwindow.showModalDialogÒ²¿ÉÒÔ´ò¿ªÒ»¸öд°Ì壬²»¹ýËû´ò¿ªµÄÊÇÒ»¸öģ̬´°¿Ú£¬ÄÇôÈçºÎÔÚ¸¸´°ÌåºÍ×Ó´°ÌåÖ®¼ä´«ÖµÄØ£¿ÎÒÃÇÏÈ¿´¸Ãº¯ÊýµÄ¶¨Ò壺vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
²ÎÊý˵Ã÷£º
sURL--±ØÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´®¡£ÓÃÀ´Ö¸¶¨¶Ô»°¿òÒªÏÔʾµÄÎĵµµÄURL¡£
vArguments--¿ÉÑ¡²ÎÊý£¬ÀàÐÍ£º±äÌå¡£ÓÃÀ´Ïò¶Ô»°¿ò´«µÝ²ÎÊý¡£´«µÝµÄ²ÎÊýÀàÐͲ»ÏÞ£¬°üÀ¨Êý×éµÈ¡£¶Ô»°¿òͨ¹ýwindow.dialogArgumentsÀ´È¡µÃ´«µÝ½øÀ´µÄ²ÎÊý¡£
sFeatures--¿ÉÑ¡²ÎÊý£¬ÀàÐÍ£º×Ö·û´®¡£ÓÃÀ´ÃèÊö¶Ô»°¿òµÄÍâ¹ÛµÈÐÅÏ¢£¬¿ÉÒÔʹÓÃÒÔϵÄÒ»¸ö»ò¼¸¸ö£¬Ó÷ֺœ;”¸ô¿ª¡£
dialogHeight :¶Ô»°¿ò¸ß¶È£¬²»Ð¡ÓÚ£±£°£°px£¬£É£Å£´ÖÐdialogHeight ºÍ dialogWidth ĬÈϵĵ¥Î»ÊÇem£¬¶ø£É£Å£µÖÐÊÇpx£¬Îª·½±ãÆä¼û£¬ÔÚ¶¨Òåmodal·½Ê½µÄ¶Ô»°¿òʱ£¬ÓÃpx×öµ¥Î»¡£
dialogWidth: ¶Ô»°¿ò¿í¶È¡£
dialogLeft: ÀëÆÁÄ»×óµÄ¾àÀë¡£
dialogTop: ÀëÆÁÄ»ÉϵľàÀë¡£
center: {yes | no | 1 | 0 }£º´°¿ÚÊÇ·ñ¾ÓÖУ¬Ä¬ÈÏyes£¬µ«ÈÔ¿ÉÒÔÖ¸¶¨¸ß¶ÈºÍ¿í¶È¡£
help: {yes | no | 1 | 0 }£ºÊÇ·ñÏÔʾ°ïÖú°´Å¥£¬Ä¬ÈÏyes¡£
resizable: {yes | no | 1 | 0 } [IE5+]:ÊÇ·ñ¿É±»¸Ä±ä´óС¡£Ä¬ÈÏno¡£
status: {yes | no | 1 | 0 } [IE5+]:ÊÇ·ñÏÔʾ״̬À¸¡£Ä¬ÈÏΪyes[ Modeless]»òno[Modal]¡£
scroll:{ yes | no | 1 | 0 | on | off }£ºÖ¸Ã÷¶Ô»°¿òÊÇ·ñÏÔʾ¹ö¶¯Ìõ¡£Ä¬ÈÏΪyes¡£
È磺"dialogWidth=200px;dialogHeight=100px"
Òò´ËÎÒÃÇ¿ÉÒÔͨ¹ýwindow.dialogArguments²ÎÊýÀ´ÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ
ÈçÏÂÃæÁ½¸öÒ³Ã棺FatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{
window.showModalDialog('ChildPage.htm',document.getElementById('txtInput').value);
}
</script>
<input type="text" id="txtInput" />
<input type="button" value="OpenChild" onclick="OpenChildWindow()" />
ChildPage.htm:
XML-Code:
<body onload="Load()">
<scrip
Ïà¹ØÎĵµ£º
×î½üÔÚѧXML£¬¿´ÊéµÄ¹ý³ÌÖÐ˳±ã×öµã±Ê¼Ç£¬¹©ÒÔºó²Î¿¼
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<mce:script language=javascript><!--
var oNodeMap,str,oList,item;
//´´½¨DOMDocument¶ÔÏó
......
ͨ¹ýÇëÇóµÄheaderÖпÉÒÔ¿´µ½ User-Agent Ïî
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0; CIBA)
ÕâÀï¼Ç¼Á˱¾µØÐÅÏ¢£¬Í¨¹ýÕâÀïµÄ.Net CLR xxxxx£¬¿ÉÒÔÅÐ¶Ï ......
JavaScript ×Ö·û´®×ª»»Êý×Ö(תÔØ)
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ»ØµÄ¶¼ÊÇNaN(Not a Number)¡£
ÔÚÅ ......
¹ØÓÚThis
1. ËüÊÇÒ»¸ö¹Ø¼ü×Ö£¬²¢²»ÊDZäÁ¿Ãû»òÊôÐÔÃû¡£
2. Ëüʵ¼ÊÖ¸functionËù¹ØÁªµÄ¶ÔÏó£¬Èç¹ûfunctionûÓйØÁªÈκζÔÏó£¬ÔòthisÊÇGlobal¶ÔÏó
var msg = 'I am global';
function showMsg(){
alert(this.msg);
};
function nestedShowMsg (){
var nested = function(){
alert(this.msg);
};
nested();
......
<html>
<head>
<title></title>
</head>
<body>
<form id=aa name=aa>
<input type=button value="ͬÒâ(10)" id=a1 disabled="disabled">
</form>
</body>
</html>
<script>
var num=10;
window.setTimeout("aa()",1000);
function ......