{"id":41,"date":"2018-03-26T09:18:06","date_gmt":"2018-03-26T01:18:06","guid":{"rendered":"http:\/\/www.nickyoo7.pro\/?p=41"},"modified":"2018-03-26T09:19:20","modified_gmt":"2018-03-26T01:19:20","slug":"%e4%bd%bf%e7%94%a8-javascript-%e7%94%a2%e7%94%9f%e4%ba%82%e6%95%b8%e5%af%86%e7%a2%bc","status":"publish","type":"post","link":"https:\/\/www.nickyoo7.com\/?p=41","title":{"rendered":"\u4f7f\u7528 JavaScript \u7522\u751f\u4e82\u6578\u5bc6\u78bc"},"content":{"rendered":"<p>\u4f7f\u7528 JavaScript \u7522\u751f\u4e82\u6578\u5bc6\u78bc.<!--more--><\/p>\n<pre class=\"lang:js decode:true\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction CreatePW () {\r\n\tvar allPw={\r\n        \"Number\":\"0123456789\",\r\n        \"Upper\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\r\n        \"Lower\":\"abcdefghijklmnopqrstuvwxyz\",\r\n        \"Punctuation\":\"~!@#$%^&amp;*()_+[]{}|`;:,.\/?&gt;&lt;-=\"\r\n\t}\r\n\tvar allowPw=\"\";\r\n\tfor (var i = 0; i &lt; document.getElementsByName(\"pwType\").length; i++) {\r\n\t\tif (document.getElementsByName(\"pwType\")[i].checked) {\r\n\t\t\tallowPw+=allPw[document.getElementsByName(\"pwType\")[i].value];\r\n\t\t};\r\n\t};\r\n\tvar pwLength=parseInt(document.getElementsByName(\"pwLength\")[0].value,10);\r\n\tvar pwCounts=parseInt(document.getElementsByName(\"pwCounts\")[0].value,10);\r\n\tvar pwResult='&lt;table class=\"table table-striped table-hover\"&gt;&lt;tbody&gt;';\r\n\tfor (var c=0;c &lt; pwCounts; c++){\r\n\t\tpwResult+='&lt;tr class=\"active\"&gt;&lt;td class=\"word-break-all\"&gt;&lt;input type=\"text\" size=\"' + (pwLength+2) + '\" value=\"';\r\n\t\tfor (var i = 0; i &lt; pwLength; i++) {\r\n\t\t\tvar nowRandom=parseInt(Math.random()*allowPw.length,10);\r\n\t\t\tpwResult+=allowPw.substring(nowRandom, nowRandom+1);\r\n\r\n\t\t};\r\n\t\tpwResult+='\" readonly&gt;&lt;\/td&gt;&lt;\/tr&gt;';\r\n\t}\r\n\tpwResult+='&lt;\/tbody&gt;&lt;\/table&gt;';\r\n\tdocument.getElementById(\"newPW\").innerHTML=pwResult;\r\n}\r\n&lt;\/script&gt;<\/pre>\n<p>\u5b8c\u6574\u7bc4\u4f8b :\u00a0<a href=\"http:\/\/www.nickyoo7.pro\/wp-content\/uploads\/2018\/03\/\u5bc6\u78bc\u7522\u751f\u5668.htm\">\u5bc6\u78bc\u7522\u751f\u5668<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 JavaScript \u7522\u751f\u4e82\u6578\u5bc6\u78bc.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-javascript","entry"],"_links":{"self":[{"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=41"}],"version-history":[{"count":2,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nickyoo7.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}