{"id":74789,"date":"2023-12-30T18:38:22","date_gmt":"2023-12-30T10:38:22","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=74789"},"modified":"2023-12-30T18:38:22","modified_gmt":"2023-12-30T10:38:22","slug":"syctsjmqdkflq","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/74789.html","title":{"rendered":"\u4f7f\u7528Chrome Console\u8c03\u8bd5\uff1a\u89e3\u5bc6\u524d\u7aef\u5f00\u53d1\u5229\u5668"},"content":{"rendered":"

  Chrome Console\u662f\u524d\u7aef\u5f00\u53d1\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u4e4b\u4e00\uff0c\u901a\u8fc7\u672c\u6587\u4f60\u5c06\u4e86\u89e3\u5230\u5982\u4f55\u5145\u5206\u5229\u7528Chrome Console\u8fdb\u884c\u524d\u7aef\u4ee3\u7801\u8c03\u8bd5\u548c\u6027\u80fd\u4f18\u5316\u3002<\/p>\n

Chrome Console\u8c03\u8bd5\u6280\u5de7<\/h2>\n

  \u57fa\u672c\u547d\u4ee4\u548c\u4f7f\u7528\u65b9\u5f0f<\/h3>\n

  Chrome Console\u662fChrome\u6d4f\u89c8\u5668\u81ea\u5e26\u7684\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u901a\u8fc7\u6309\u4e0bF12\u6216\u53f3\u952e\u70b9\u51fb\u9875\u9762\u5e76\u9009\u62e9\u201c\u68c0\u67e5\u201d\u6253\u5f00\u3002\u5728Console\u9009\u9879\u5361\u4e0b\uff0c\u53ef\u4ee5\u8f93\u5165JavaScript\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u7ed3\u679c\u3002\u4f7f\u7528console.log()\u53ef\u4ee5\u8f93\u51fa\u53d8\u91cf\u6216\u8005\u4fe1\u606f\uff0c\u800cconsole.error()\u53ef\u4ee5\u7528\u6765\u8f93\u51fa\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n

  \u8c03\u8bd5JavaScript\u4ee3\u7801<\/h4>\n

  \u5f53\u9875\u9762\u51fa\u73b0JavaScript\u9519\u8bef\u65f6\uff0cConsole\u5c06\u4f1a\u663e\u793a\u9519\u8bef\u6d88\u606f\u548c\u5bf9\u5e94\u7684\u4ee3\u7801\u884c\u6570\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002\u540c\u65f6\uff0c\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\uff0c\u9010\u884c\u8c03\u8bd5\u4ee3\u7801\uff0c\u67e5\u770b\u53d8\u91cf\u503c\u7b49\u3002\u8fd9\u5bf9\u4e8e\u8c03\u8bd5\u590d\u6742\u7684JavaScript\u4ee3\u7801\u975e\u5e38\u6709\u5e2e\u52a9\u3002<\/p>\n

  \u6027\u80fd\u5206\u6790\u4e0e\u4f18\u5316<\/h4>\n

  \u901a\u8fc7Performance\u9009\u9879\u5361\uff0c\u53ef\u4ee5\u8fdb\u884c\u6027\u80fd\u5206\u6790\uff0c\u67e5\u770b\u9875\u9762\u52a0\u8f7d\u65f6\u95f4\u3001\u8d44\u6e90\u6d88\u8017\u7b49\u3002\u6839\u636e\u6027\u80fd\u5206\u6790\u7ed3\u679c\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\u4ee3\u7801\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u5347\u9875\u9762\u52a0\u8f7d\u901f\u5ea6\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n

\u5229\u7528Console\u63d0\u9ad8\u5f00\u53d1\u6548\u7387<\/h2>\n

  \u5feb\u901f\u5b9a\u4f4d\u9875\u9762\u5143\u7d20<\/h3>\n

  \u5728Console\u4e2d\u4f7f\u7528document.querySelector()\u6216document.getElementById()\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u9875\u9762\u4e2d\u7684\u5143\u7d20\uff0c\u907f\u514d\u53cd\u590d\u70b9\u51fb\u9875\u9762\u67e5\u627e\u5143\u7d20\u3002\u540c\u65f6\uff0c\u4fee\u6539\u5143\u7d20\u5c5e\u6027\u4e5f\u53ef\u4ee5\u5373\u65f6\u5728\u9875\u9762\u4e2d\u770b\u5230\u6548\u679c\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n

  \u52a8\u6001\u8c03\u8bd5CSS\u6837\u5f0f<\/h4>\n

  \u901a\u8fc7Console\u53ef\u4ee5\u52a8\u6001\u4fee\u6539\u9875\u9762\u5143\u7d20\u7684\u6837\u5f0f\uff0c\u5b9e\u65f6\u67e5\u770b\u6548\u679c\u3002\u8fd9\u5bf9\u4e8e\u8c03\u8bd5\u548c\u4f18\u5316\u9875\u9762\u6837\u5f0f\u975e\u5e38\u6709\u7528\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u65f6\u8c03\u6574\u6837\u5f0f\u53c2\u6570\uff0c\u5feb\u901f\u627e\u5230\u6700\u4f73\u6837\u5f0f\u65b9\u6848\u3002<\/p>\n

  \u6a21\u62df\u7528\u6237\u884c\u4e3a<\/h4>\n

  \u4f7f\u7528Console\u6a21\u62df\u7528\u6237\u70b9\u51fb\u3001\u6eda\u52a8\u7b49\u64cd\u4f5c\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5feb\u901f\u6d4b\u8bd5\u9875\u9762\u4ea4\u4e92\u529f\u80fd\u3002\u8fd9\u6837\u53ef\u4ee5\u7701\u53bb\u624b\u52a8\u64cd\u4f5c\u9875\u9762\u7684\u65f6\u95f4\uff0c\u63d0\u9ad8\u6d4b\u8bd5\u6548\u7387\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  Chrome Console\u662f\u524d\u7aef\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5f3a\u5927\u7684\u8c03\u8bd5\u5229\u5668\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u5b9a\u4f4d\u5e76\u89e3\u51b3\u95ee\u9898\uff0c\u8fd8\u53ef\u4ee5\u4f18\u5316\u4ee3\u7801\u548c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/strong>\u719f\u7ec3\u638c\u63e1Chrome Console\u7684\u4f7f\u7528\u65b9\u6cd5\u5bf9\u4e8e\u524d\u7aef\u5f00\u53d1\u8005\u6765\u8bf4\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u901a\u8fc7\u672c\u6587\u4ecb\u7ecd\u7684\u6280\u5de7\uff0c\u76f8\u4fe1\u4f60\u5bf9Chrome Console\u5df2\u7ecf\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\uff0c\u5e0c\u671b\u4f60\u53ef\u4ee5\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u52a0\u4ee5\u5e94\u7528\uff0c\u53d6\u5f97\u66f4\u597d\u7684\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

ChromeConsole\u662f\u524d\u7aef\u5f00\u53d1\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u4e4b\u4e00\uff0c\u901a\u8fc7\u672c\u6587\u4f60\u5c06\u4e86\u89e3\u5230\u5982\u4f55\u5145\u5206\u5229\u7528ChromeConsole\u8fdb\u884c\u524d\u7aef\u4ee3\u7801\u8c03\u8bd5\u548c\u6027\u80fd\u4f18\u5316\u3002ChromeCon<\/p>\n","protected":false},"author":1,"featured_media":64183,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[52],"class_list":["post-74789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-wxtx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/74789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=74789"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/74789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64183"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=74789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=74789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=74789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}