{"id":1928,"date":"2023-03-25T14:26:38","date_gmt":"2023-03-25T06:26:38","guid":{"rendered":""},"modified":"2023-03-25T14:26:38","modified_gmt":"2023-03-25T06:26:38","slug":"ES6 \u5bf9\u8bdd\u6846","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1928.html","title":{"rendered":"ES6 \u5bf9\u8bdd\u6846"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

ES6 \u5bf9\u8bdd\u6846<\/h1>\n<\/p><\/div>\n

ES6 \u5bf9\u8bdd\u6846<\/h2>\n
\n JavaScript \u652f\u6301\u4e09\u79cd\u7c7b\u578b\u7684\u5bf9\u8bdd\u6846 a> \u662f\u8b66\u62a5\u3001\u786e\u8ba4\u3001\u548c\u63d0\u793a\u3002\u8fd9\u4e9b\u5bf9\u8bdd\u6846\u53ef\u7528\u4e8e\u6267\u884c\u7279\u5b9a\u4efb\u52a1\uff0c\u4f8b\u5982\u53d1\u51fa\u8b66\u62a5\u3001\u83b7\u5f97\u4e8b\u4ef6\u6216\u8f93\u5165\u7684\u786e\u8ba4\u4ee5\u53ca\u83b7\u5f97\u7528\u6237\u7684\u8f93\u5165\u3002\n <\/div>\n
\n \u8ba9\u6211\u4eec\u8ba8\u8bba\u6bcf\u4e2a\u5bf9\u8bdd\u6846\u3002\n <\/div>\n

\u8b66\u62a5\u5bf9\u8bdd\u6846<\/h2>\n
\n \u7528\u4e8e\u5411\u7528\u6237\u63d0\u4f9b\u8b66\u544a\u4fe1\u606f\u3002\u5b83\u662f JavaScript \u4e2d\u4f7f\u7528\u6700\u5e7f\u6cdb\u7684\u5bf9\u8bdd\u6846\u4e4b\u4e00\u3002\u5b83\u53ea\u6709\u4e00\u4e2a'OK'\u6309\u94ae\u6765\u7ee7\u7eed\u5e76\u9009\u62e9\u4e0b\u4e00\u4e2a\u4efb\u52a1\u3002\n <\/div>\n
\n \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u7406\u89e3\u5b83\uff0c\u6bd4\u5982\u5047\u8bbe\u4e00\u4e2a\u6587\u672c\u5b57\u6bb5\u662f\u5fc5\u987b\u586b\u5199\u7684\uff0c\u4f46\u662f\u7528\u6237\u6ca1\u6709\u4e3a\u8be5\u6587\u672c\u5b57\u6bb5\u63d0\u4f9b\u4efb\u4f55\u8f93\u5165\u503c\uff0c\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8b66\u62a5\u6846\u663e\u793a\u8b66\u544a\u6d88\u606f\u3002\n <\/div>\n
\n \u8bed\u6cd5\n <\/div>\n
\n
\nalert(message);<\/pre>\n

<\/code>\n <\/div>\n

\n \u4f8b\u5b50\n <\/div>\n
\n \u8ba9\u6211\u4eec\u901a\u8fc7\u4e0b\u9762\u7684\u4f8b\u5b50\u6765\u770b\u770b\u4e00\u4e2a\u8b66\u544a\u5bf9\u8bdd\u6846\u7684\u6f14\u793a\u3002\n <\/div>\n
\n
\n<html> \n  \n<head>  \n    <script type=\"text\/javascript\"<\/span>> \n        function show() { \n            alert(\"It is an Alert dialog box\"<\/span>); \n        } \n    <\/script> \n<\/head> \n  \n<body> \n    <center> \n        <h1>Hello World :) :)<\/h1> \n        <h2>Welcome to lidihuo<\/h2> \n        <p>Click the following button <\/p> \n        <input type=\"button\"<\/span> value=\"Click Me\"<\/span> onclick=\"show();\"<\/span> \/> \n    <\/center> \n<\/body> \n  \n<\/html><\/pre>\n

<\/code>\n <\/div>\n

\n \u8f93\u51fa\n <\/div>\n
\n \u6210\u529f\u6267\u884c\u4ee5\u4e0a\u4ee3\u7801\u540e\uff0c\u4f1a\u5f97\u5230\u5982\u4e0b\u8f93\u51fa\u3002\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c1\u5f20 <\/p>\n

\n \u70b9\u51fb\u70b9\u51fb\u6211\u6309\u94ae\u540e\uff0c\u4f60\u4f1a\u5f97\u5230\u5982\u4e0b\u8f93\u51fa:\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c2\u5f20 <\/p>\n

\u786e\u8ba4\u5bf9\u8bdd\u6846<\/h3>\n
\n \u5e7f\u6cdb\u7528\u4e8e\u53d6\u610f\u89c1\u4ece\u7528\u6237\u5bf9\u5177\u4f53\u9009\u9879\u3002\u5b83\u5305\u62ec\u4e24\u4e2a\u6309\u94ae\uff0c\u786e\u5b9a \u548c\u53d6\u6d88\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5047\u8bbe\u7528\u6237\u9700\u8981\u5220\u9664\u4e00\u4e9b\u6570\u636e\uff0c\u90a3\u4e48\u9875\u9762\u53ef\u4ee5\u901a\u8fc7\u662f\u5426\u8981\u5220\u9664\u7684\u786e\u8ba4\u6846\u6765\u786e\u8ba4\u3002\n <\/div>\n
\n \u5982\u679c\u7528\u6237\u70b9\u51fbOK \u6309\u94ae\uff0c\u7136\u540e\u65b9\u6cd5 confirm() \u8fd4\u56de true\u3002\u4f46\u662f\u5982\u679c\u7528\u6237\u70b9\u51fb\u53d6\u6d88\u6309\u94ae\uff0cconfirm()\u65b9\u6cd5\u8fd4\u56defalse\u3002\n <\/div>\n
\n \u8bed\u6cd5\n <\/div>\n
\n
\nconfirm(message);<\/pre>\n

<\/code>\n <\/div>\n

\n \u793a\u4f8b\n <\/div>\n
\n \u8ba9\u6211\u4eec\u901a\u8fc7\u4e0b\u9762\u7684\u793a\u4f8b\u6765\u7406\u89e3\u8fd9\u4e2a\u5bf9\u8bdd\u6846\u7684\u6f14\u793a\u3002\n <\/div>\n
\n
\n<html> \n  \n<head>  \n    <script type=\"text\/javascript\"<\/span>> \n        function show() { \n            var <\/span>con = confirm (\"It is a Confirm dialog box\"<\/span>); \n            if(con == true<\/span><\/span>) { \n                document.write <\/span>(\"User Want to continue<\/span>\"<\/span>); \n            }  \n            else <\/span>{ \n                document.write <\/span>(\"User does not want to continue<\/span>\"<\/span>); \n            } \n        } \n    <\/script> \n<\/head> \n  \n<body> \n    <center> \n        <h1>Hello World :) :)<\/h1> \n        <h2>Welcome to lidihuo<\/h2> \n        <p>Click the following button <\/p> \n        <input type=\"button\"<\/span> value=\"Click Me\"<\/span> onclick=\"show();\"<\/span> \/> \n    <\/center> \n<\/body> \n  \n<\/html><\/pre>\n

<\/code>\n <\/div>\n

\n \u8f93\u51fa\n <\/div>\n
\n \u6210\u529f\u6267\u884c\u4ee5\u4e0a\u4ee3\u7801\u540e\uff0c\u4f1a\u5f97\u5230\u5982\u4e0b\u8f93\u51fa\u3002\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c3\u5f20 <\/p>\n

\n \u5f53\u4f60\u70b9\u51fb\u7ed9\u5b9a\u7684\u6309\u94ae\u65f6\uff0c\u4f60\u4f1a\u5f97\u5230\u4ee5\u4e0b\u8f93\u51fa:\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c4\u5f20 <\/p>\n

\n \u70b9\u51fb\u786e\u5b9a\u6309\u94ae\u540e\uff0c\u4f1a\u5f97\u5230:\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c5\u5f20 <\/p>\n

\n \u70b9\u51fb\u53d6\u6d88\u6309\u94ae\uff0c\u4f60\u4f1a\u5f97\u5230:\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c6\u5f20 <\/p>\n

\u63d0\u793a\u5bf9\u8bdd\u6846<\/h2>\n
\n \u63d0\u793a\u5bf9\u8bdd\u6846\u5728\u9700\u8981\u65f6\u4f7f\u7528\u5f39\u51fa\u4e00\u4e2a\u6587\u672c\u6846\u6765\u83b7\u53d6\u7528\u6237\u8f93\u5165\u3002\u56e0\u6b64\uff0c\u5b83\u53ef\u4ee5\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\u3002\n <\/div>\n
\n \u63d0\u793a\u5bf9\u8bdd\u6846\u4e5f\u6709\u4e24\u4e2a\u6309\u94ae\uff0c\u5206\u522b\u662f\u786e\u5b9a\u548c\u53d6\u6d88\u3002\u7528\u6237\u9700\u8981\u5728\u6587\u672c\u6846\u4e2d\u63d0\u4f9b\u8f93\u5165\uff0c\u7136\u540e\u5355\u51fb\u786e\u5b9a\u3002\u5f53\u7528\u6237\u5355\u51fb\"\u786e\u5b9a\"\u6309\u94ae\u65f6\uff0c\u5bf9\u8bdd\u6846\u4f1a\u8bfb\u53d6\u8be5\u503c\u5e76\u5c06\u5176\u8fd4\u56de\u7ed9\u7528\u6237\u3002\u4f46\u662f\u70b9\u51fb\u53d6\u6d88\u6309\u94ae\u540e\uff0cprompt()\u65b9\u6cd5\u8fd4\u56denull\u3002\n <\/div>\n
\n \u8bed\u6cd5\n <\/div>\n
\n
\nprompt(message, default_string);<\/pre>\n

<\/code>\n <\/div>\n

\n \u8ba9\u6211\u4eec\u901a\u8fc7\u4e0b\u56fe\u6765\u7406\u89e3\u63d0\u793a\u5bf9\u8bdd\u6846\u3002\n <\/div>\n
\n \u793a\u4f8b\n <\/div>\n
\n
\n<html> \n  \n<head>  \n    <script type=\"text\/javascript\"<\/span>> \n        function show() { \n            var <\/span>value = prompt(\"Enter your Name : \"<\/span>, \"Enter your name\"<\/span>); \n            document.write<\/span>(\"Your Name is : \"<\/span> + value); \n        } \n    <\/script> \n<\/head> \n  \n<body> \n    <center> \n        <h1>Hello World :) :)<\/h1> \n        <h2>Welcome to lidihuo<\/h2> \n        <p>Click the following button <\/p> \n        <input type=\"button\"<\/span> value=\"Click Me\"<\/span> onclick=\"show();\"<\/span> \/> \n    <\/center> \n<\/body> \n  \n<\/html><\/pre>\n

<\/code>\n <\/div>\n

\n \u8f93\u51fa\n <\/div>\n
\n \u6267\u884c\u4e0a\u8ff0\u4ee3\u7801\u6210\u529f\u540e\uff0c\u4f1a\u5f97\u5230\u5982\u4e0b\u8f93\u51fa\u3002\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c7\u5f20 <\/p>\n

\n \u5f53\u60a8\u5355\u51fb\u5355\u51fb\u6211\u6309\u94ae\u65f6\uff0c\u60a8\u5c06\u83b7\u5f97\u4ee5\u4e0b\u8f93\u51fa:\n <\/div>\n

ES6 \u5bf9\u8bdd\u6846_https:\/\/bianchenghao6.com_\u3010ES6 \u6559\u7a0b\u3011_\u7b2c8\u5f20 <\/p>\n

\n \u8f93\u5165\u4f60\u7684\u540d\u5b57\u5e76\u70b9\u51fb\u786e\u5b9a\u6309\u94ae\uff0c\u4f60\u4f1a\u5f97\u5230:\n <\/div>\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"ES6 \u5bf9\u8bdd\u6846zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[161],"tags":[],"class_list":["post-1928","post","type-post","status-publish","format-standard","hentry","category-es6jc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1928"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=1928"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1928\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}