{"id":48,"date":"2013-01-24T14:23:17","date_gmt":"2013-01-24T06:23:17","guid":{"rendered":"http:\/\/weitaoc.com\/?p=48"},"modified":"2013-01-24T14:23:17","modified_gmt":"2013-01-24T06:23:17","slug":"%e7%94%b1%e5%85%b3%e9%97%ad%e6%b5%8f%e8%a7%88%e5%99%a8%e4%ba%8b%e4%bb%b6%e5%bc%95%e5%8f%91%e7%9a%84js%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/weitaoc.com\/?p=48","title":{"rendered":"\u7531\u5173\u95ed\u6d4f\u89c8\u5668\u4e8b\u4ef6\u5f15\u53d1\u7684js\u65b9\u6cd5"},"content":{"rendered":"<p>\u524d\u51e0\u5929\u4e00\u540c\u4e8b\u95ee\u6211\uff0c\u600e\u4e48\u8ba9\u6d4f\u89c8\u5668\u5173\u95ed\u65f6\u8df3\u51fa\u4e00\u4e2a\u7a97\u53e3\uff0c\u8981\u6c42\u7a97\u53e3\u663e\u793a\u7528\u6237\u8bc4\u4ef7\u3002<\/p>\n<p>\u6211\u9996\u5148\u60f3\u5230\u7684\u662f\u5f39\u51fa\u5c42\uff0c\u56e0\u4e3a\u5c42\u5c55\u793a\u7684\u7528\u6237\u4f53\u9a8c\u6bd4\u8f83\u597d\u3002\u4f46\u662f\u6211\u6d4b\u8bd5\u4e86\u591a\u6b21\u53d1\u73b0\u4e0d\u884c\uff0c\u5173\u95ed\u4e8b\u4ef6\u5bf9\u9875\u9762\u5185\u90e8\u7684\u8bf7\u6c42\u65e0\u6548\u3002\u540e\u6765\u60f3\u5230window.open\uff0c\u73b0\u5728\u6d4f\u89c8\u5668\u90fd\u91c7\u7528tabs\uff0c\u9875\u9762\u5f39\u4e0d\u51fa\u6765\u5c31\u7ed9\u5173\u95ed\u4e86\u3002<\/p>\n<p>\u67e5\u4e86\u4e00\u4e0b\u8d44\u6599\uff0c\u627e\u5230\u4e86showModalDialog()\u548cshowModelessDialog()\u65b9\u6cd5\u3002\u524d\u9762\u63d0\u5230\u4e86\u9700\u8981\u5728\u5173\u95ed\u6d4f\u89c8\u5668\u65f6\uff0c\u5f3a\u5236\u7528\u6237\u8fdb\u884c\u8bc4\u4ef7\u3002\u76f8\u5f53\u611f\u8c22\u8fbe\u4eba\u4eec\uff0c\u4ed6\u4eec\u592a\u8d34\u5fc3\u4e86\uff0c\u56e0\u4e3a\u8fd9\u4e24\u4e2a\u65b9\u6cd5\u6d89\u53ca\u4e24\u4e2a\u6982\u5ff5\uff1a\u6a21\u6001\u548c\u975e\u6a21\u6001\u3002<\/p>\n<p>\u6a21\u6001\u5bf9\u8bdd\u6846\uff08Modal Dialogue Box\uff0c\u53c8\u53eb\u505a\u6a21\u5f0f\u5bf9\u8bdd\u6846\uff09\uff0c\u662f\u6307\u5728\u7528\u6237\u60f3\u8981\u5bf9\u5bf9\u8bdd\u6846\u4ee5\u5916\u7684\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u5fc5\u987b\u9996\u5148\u5bf9\u8be5\u5bf9\u8bdd\u6846\u8fdb\u884c\u54cd\u5e94\u3002\u5982\u5355\u51fb\u3010\u786e\u5b9a\u3011\u6216\u3010\u53d6\u6d88\u3011\u6309\u94ae\u7b49\u5c06\u8be5\u5bf9\u8bdd\u6846\u5173\u95ed\u3002\u4e5f\u5c31\u662f\u6211\u4eec\u4f7f\u7528\u6a21\u6001\u5bf9\u8bdd\u6846\u65f6\uff0c\u7528\u6237\u53ea\u80fd\u64cd\u4f5c\u6211\u4eec\u6a21\u6001\u5316\u7684\u6a21\u5757\uff0c\u5982\u6211\u4eec\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\uff0c\u7528\u6237\u4efb\u7136\u80fd\u591f\u64cd\u4f5c\u4e3b\u9875\u9762\uff0c\u5f88\u663e\u7136\u662f\u4e0d\u7b26\u5408\u9700\u6c42\u3002<\/p>\n<p>\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u6070\u597d\u76f8\u53cd\uff0c\u5141\u8bb8\u7528\u6237\u64cd\u4f5c\u5176\u4ed6\u6a21\u5757\u3002\u4f46\u662f\u4e0d\u7b26\u5408\u6211\u4eec\u7684\u573a\u666f\u9700\u6c42\u3002<\/p>\n<p>\u8fd9\u91cc\uff0cwindow.showModalDialog()\u65b9\u6cd5\u7528\u6765\u521b\u5efa\u4e00\u4e2a\u663e\u793aHTML\u5185\u5bb9\u7684\u6a21\u6001\u5bf9\u8bdd\u6846\u3002window.showModelessDialog()\u65b9\u6cd5\u7528\u6765\u521b\u5efa\u4e00\u4e2a\u663e\u793aHTML\u5185\u5bb9\u7684\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u3002<\/p>\n<p>\u6211\u4eec\u91c7\u7528window.showModalDialog()\u3002<\/p>\n<p><strong>\u4f7f\u7528\u65b9\u6cd5<\/strong><\/p>\n<p>vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])<br \/>\nvReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])<\/p>\n<p><strong>\u53c2\u6570\u8bf4\u660e<\/strong><\/p>\n<p>sURL&#8211;<br \/>\n\u5fc5\u9009\u53c2\u6570\uff0c\u7c7b\u578b\uff1a\u5b57\u7b26\u4e32\u3002\u7528\u6765\u6307\u5b9a\u5bf9\u8bdd\u6846\u8981\u663e\u793a\u7684\u6587\u6863\u7684URL\u3002<br \/>\nvArguments&#8211;<br \/>\n\u53ef\u9009\u53c2\u6570\uff0c\u7c7b\u578b\uff1a\u53d8\u4f53\u3002\u7528\u6765\u5411\u5bf9\u8bdd\u6846\u4f20\u9012\u53c2\u6570\u3002\u4f20\u9012\u7684\u53c2\u6570\u7c7b\u578b\u4e0d\u9650\uff0c\u5305\u62ec\u6570\u7ec4\u7b49\u3002\u5bf9\u8bdd\u6846\u901a\u8fc7window.dialogArguments\u6765\u53d6\u5f97\u4f20\u9012\u8fdb\u6765\u7684\u53c2\u6570\u3002<br \/>\nsFeatures&#8211;<br \/>\n\u53ef\u9009\u53c2\u6570\uff0c\u7c7b\u578b\uff1a\u5b57\u7b26\u4e32\u3002\u7528\u6765\u63cf\u8ff0\u5bf9\u8bdd\u6846\u7684\u5916\u89c2\u7b49\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u7684\u4e00\u4e2a\u6216\u51e0\u4e2a\uff0c\u7528\u5206\u53f7\u201c;\u201d\u9694\u5f00\u3002<br \/>\n1.dialogHeight :\u5bf9\u8bdd\u6846\u9ad8\u5ea6\uff0c\u4e0d\u5c0f\u4e8e\uff11\uff10\uff10px\uff0c\uff29\uff25\uff14\u4e2ddialogHeight \u548c dialogWidth \u9ed8\u8ba4\u7684\u5355\u4f4d\u662fem\uff0c\u800c\uff29\uff25\uff15\u4e2d\u662fpx\uff0c\u4e3a\u65b9\u4fbf\u5176\u89c1\uff0c\u5728\u5b9a\u4e49modal\u65b9\u5f0f\u7684\u5bf9\u8bdd\u6846\u65f6\uff0c\u7528px\u505a\u5355\u4f4d\u3002<br \/>\n2.dialogWidth: \u5bf9\u8bdd\u6846\u5bbd\u5ea6\u3002<br \/>\n3.dialogLeft: \u79bb\u5c4f\u5e55\u5de6\u7684\u8ddd\u79bb\u3002<br \/>\n4.dialogTop: \u79bb\u5c4f\u5e55\u4e0a\u7684\u8ddd\u79bb\u3002<br \/>\n5.center: {yes | no | 1 | 0 }\uff1a\u7a97\u53e3\u662f\u5426\u5c45\u4e2d\uff0c\u9ed8\u8ba4yes\uff0c\u4f46\u4ecd\u53ef\u4ee5\u6307\u5b9a\u9ad8\u5ea6\u548c\u5bbd\u5ea6\u3002<br \/>\n6.help: {yes | no | 1 | 0 }\uff1a\u662f\u5426\u663e\u793a\u5e2e\u52a9\u6309\u94ae\uff0c\u9ed8\u8ba4yes\u3002<br \/>\n7.resizable: {yes | no | 1 | 0 } \uff3b\uff29\uff25\uff15\uff0b\uff3d\uff1a\u662f\u5426\u53ef\u88ab\u6539\u53d8\u5927\u5c0f\u3002\u9ed8\u8ba4no\u3002<br \/>\n8.status: {yes | no | 1 | 0 } \uff3bIE5+\uff3d\uff1a\u662f\u5426\u663e\u793a\u72b6\u6001\u680f\u3002\u9ed8\u8ba4\u4e3ayes[ Modeless]\u6216no[Modal]\u3002<br \/>\n9.scroll:{ yes | no | 1 | 0 | on | off }\uff1a\u6307\u660e\u5bf9\u8bdd\u6846\u662f\u5426\u663e\u793a\u6eda\u52a8\u6761\u3002\u9ed8\u8ba4\u4e3ayes\u3002<br \/>\n\u4e0b\u9762\u51e0\u4e2a\u5c5e\u6027\u662f\u7528\u5728HTA\u4e2d\u7684\uff0c\u5728\u4e00\u822c\u7684\u7f51\u9875\u4e2d\u4e00\u822c\u4e0d\u4f7f\u7528\u3002<br \/>\n10.dialogHide:{ yes | no | 1 | 0 | on | off }\uff1a\u5728\u6253\u5370\u6216\u8005\u6253\u5370\u9884\u89c8\u65f6\u5bf9\u8bdd\u6846\u662f\u5426\u9690\u85cf\u3002\u9ed8\u8ba4\u4e3ano\u3002<br \/>\n11.edge:{ sunken | raised }\uff1a\u6307\u660e\u5bf9\u8bdd\u6846\u7684\u8fb9\u6846\u6837\u5f0f\u3002\u9ed8\u8ba4\u4e3araised\u3002<br \/>\n12.unadorned:{ yes | no | 1 | 0 | on | off }\uff1a\u9ed8\u8ba4\u4e3ano\u3002<\/p>\n<p><strong>\u53c2\u6570\u4f20\u9012<\/strong><\/p>\n<p>1.\u8981\u60f3\u5bf9\u8bdd\u6846\u4f20\u9012\u53c2\u6570\uff0c\u662f\u901a\u8fc7vArguments\u6765\u8fdb\u884c\u4f20\u9012\u7684\u3002\u7c7b\u578b\u4e0d\u9650\u5236\uff0c\u5bf9\u4e8e\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u6700\u5927\u4e3a4096\u4e2a\u5b57\u7b26\u3002\u4e5f\u53ef\u4ee5\u4f20\u9012\u5bf9\u8c61\uff0c\u4f8b\u5982\uff1a<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nparent.htm<\/p>\n<p>var obj = new Object();<br \/>\nobj.name=&#8221;51js&#8221;;<br \/>\nwindow.showModalDialog(&#8220;modal.htm&#8221;,obj,&#8221;dialogWidth=200px;dialogHeight=100px&#8221;;<\/p>\n<p>modal.htm<\/p>\n<p>var obj = window.dialogArguments<br \/>\nalert(&#8220;\u60a8\u4f20\u9012\u7684\u53c2\u6570\u4e3a\uff1a&#8221; + obj.name)<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n2.\u53ef\u4ee5\u901a\u8fc7window.returnValue\u5411\u6253\u5f00\u5bf9\u8bdd\u6846\u7684\u7a97\u53e3\u8fd4\u56de\u4fe1\u606f\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u662f\u5bf9\u8c61\u3002\u4f8b\u5982\uff1a<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nparent.htm<\/p>\n<p>str =window.showModalDialog(&#8220;modal.htm&#8221;,,&#8221;dialogWidth=200px;dialogHeight=100px&#8221;;<br \/>\nalert(str);<\/p>\n<p>modal.htm<\/p>\n<p>window.returnValue=&#8221;http:\/\/www.51js.com&#8221;;\/<\/p>\n<p><strong>window.open\u4e0ewindow.ShowModalDialog\u7684\u533a\u522b<\/strong><\/p>\n<p>1\u3001window.open\u627e\u5f00\u7684\u7a97\u53e3\u53ef\u4ee5\u9009\u5b9a\uff0c\u53ef\u4ee5\u590d\u5236\uff0c\u5e76\u4e14\u5f39\u51fa\u7a97\u53e3\u7684\u53c2\u6570\u4e4b\u95f4\u662f\u7528&#8221;,&#8221;\u5206\u5f00\u7684\uff0c\u800cShowModalDialog\u6253\u5f00\u7684\u7a97\u53e3\u4e0d\u80fd\u5f85\u5b9a\uff0c\u4e0d\u53ef\u4ee5\u590d\u5236\uff0c\u5f39\u51fa\u7a97\u53e3\u7684\u53c2\u6570\u4e4b\u95f4\u662f\u7528&#8221;;&#8221;\u9694\u5f00\u7684\u3002<br \/>\n2\u3001open\u6253\u5f00\u7684\u7a97\u53e3\u6ca1\u6709\u8fd4\u56de\u503c\uff0c\u800cShowModalDialog\u662f\u6709\u8fd4\u56de\u503c\u7684\u3002<br \/>\n3\u3001open\u5728tabs\u6d4f\u89c8\u5668\u4e0b\u5f88\u591a\u90fd\u65e0\u6548\u3002<\/p>\n<div id=\"attachment_49\" style=\"width: 182px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/weitaoc.com\/?attachment_id=49\" rel=\"attachment wp-att-49\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-49\" class=\"size-full wp-image-49\" alt=\"js\" src=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/01\/4.jpg\" width=\"172\" height=\"121\" \/><\/a><p id=\"caption-attachment-49\" class=\"wp-caption-text\">js<\/p><\/div>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/weitaoc.com\">\u8ff7\u8def\u7684\u8001\u9f20<\/a> &raquo; <a href=\"http:\/\/weitaoc.com\/?p=48\">\u7531\u5173\u95ed\u6d4f\u89c8\u5668\u4e8b\u4ef6\u5f15\u53d1\u7684js\u65b9\u6cd5<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u524d\u51e0\u5929\u4e00\u540c\u4e8b\u95ee\u6211\uff0c\u600e\u4e48\u8ba9\u6d4f\u89c8\u5668\u5173\u95ed\u65f6\u8df3\u51fa\u4e00\u4e2a\u7a97\u53e3\uff0c\u8981\u6c42\u7a97\u53e3\u663e\u793a\u7528\u6237\u8bc4\u4ef7\u3002 \u6211\u9996\u5148\u60f3\u5230\u7684\u662f\u5f39\u51fa\u5c42\uff0c\u56e0\u4e3a\u5c42\u5c55\u793a\u7684\u7528\u6237\u4f53\u9a8c\u6bd4\u8f83\u597d\u3002\u4f46\u662f\u6211\u6d4b\u8bd5\u4e86\u591a\u6b21\u53d1\u73b0\u4e0d\u884c\uff0c\u5173\u95ed\u4e8b\u4ef6\u5bf9\u9875\u9762\u5185\u90e8\u7684\u8bf7\u6c42\u65e0\u6548\u3002\u540e\u6765\u60f3\u5230window.open\uff0c\u73b0\u5728\u6d4f\u89c8\u5668\u90fd\u91c7\u7528tabs\uff0c\u9875\u9762\u5f39\u4e0d\u51fa\u6765 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[15],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-front-end","tag-js"],"views":2783,"_links":{"self":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48"}],"version-history":[{"count":0,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}