{"id":6735,"date":"2021-10-08T22:19:00","date_gmt":"2021-10-08T14:19:00","guid":{"rendered":"https:\/\/vip.fxxkpython.com\/?p=6735"},"modified":"2021-10-09T22:31:02","modified_gmt":"2021-10-09T14:31:02","slug":"%e4%bd%bf%e7%94%a8-python-%e4%bb%8e-0-%e5%bc%80%e5%8f%91%e5%b1%9e%e4%ba%8e%e4%bd%a0%e7%9a%84%e4%b8%aa%e4%ba%ba%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f-27-flask%e4%b8%ad%e4%bd%bf%e7%94%a8-jquery","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=6735","title":{"rendered":"\u4f7f\u7528 Python \u4ece 0 \u5f00\u53d1\u5c5e\u4e8e\u4f60\u7684\u4e2a\u4eba\u7ba1\u7406\u7cfb\u7edf 27 | Flask\u4e2d\u5982\u4f55\u4f7f\u7528 jquery \u5237\u65b0\u5c40\u90e8\u9875\u9762"},"content":{"rendered":"\n<p>\u5728\u5f00\u53d1\u4f60\u7684\u9879\u76ee\u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u6709\u4e9b\u9875\u9762\u7684\u529f\u80fd\u53ea\u9700\u8981\u5237\u65b0\u5c40\u90e8\u6570\u636e\u5c31\u53ef\u4ee5\u4e86\uff0c\u4e0d\u9700\u8981\u6574\u4e2a\u9875\u9762\u90fd\u5237\u65b0\uff0c\u6bd4\u5982\u63a5\u4e0b\u6765\u6211\u8981\u7ed9\u4f60\u6f14\u793a\u7684\u8fd9\u4e2a\u300c\u8ba1\u5212\u529f\u80fd\u300d\uff1a<\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center\"><figure class=\"wp-block-media-text__media\"><video controls src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2021\/10\/\u5c4f\u5e55\u5f55\u52362021-10-09-\u4e0b\u53486.47.29-1.mov\"><\/video><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">\u5982\u4f55\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0\uff1f<\/p>\n<\/div><\/div>\n\n\n\n<p>\u50cf\u8fd9\u79cd\uff0c\u5728\u5927\u8ba1\u5212\u4e0b\u521b\u5efa\u76f8\u5173\u7684\u5c0f\u8ba1\u5212\uff0c\u4ee5\u53ca\u4efb\u52a1\u5b8c\u6210\u8fdb\u5ea6\u6761\u968f\u7740\u5c0f\u8ba1\u5212\u5b8c\u6210\u7684\u53d8\u5316\u7b49\u64cd\u4f5c\uff0c\u90fd\u662f\u9700\u8981\u5c06\u6570\u636e\u63d0\u4ea4\u5230\u540e\u7aef\uff0c\u5e76\u5728\u5f53\u524d\u9875\u9762\u5237\u65b0\u6700\u65b0\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\u5982\u4f55\u5b9e\u73b0\u5462\uff1f\u63a5\u4e0b\u6765\u6211\u5c31\u7ed9\u4f60\u6f14\u793a\u4e00\u4e0b\u3002<\/p>\n\n\n\n<h2>\u521b\u5efa\u5c0f\u8ba1\u5212<\/h2>\n\n\n\n<p>\u56e0\u4e3a\u662f\u5c40\u90e8\u6570\u636e\u8bf7\u6c42\uff0c\u6211\u4eec\u9700\u8981\u7528\u5230 JavaScript \u6765\u5b9e\u73b0\uff0c\u800c Jquery \u662f JavaScript \u66f4\u8f7b\u91cf\u7ea7\u7684\u6846\u67b6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5b83\u66f4\u65b9\u4fbf\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5728\u4f60\u7684 footer \u9875\u9762\u4e2d\u5bfc\u5165\u5b83:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&lt;script src=&quot;{{ url_for('static', filename='vendor\/jquery\/jquery.min.js') }}&quot;&gt;&lt;\/script&gt;\n<\/pre><\/div>\n\n\n\n<p>\u63a5\u7740\u5728\u4f60\u7684\u9759\u6001\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a js \u6587\u4ef6\u4e13\u95e8\u6765\u5199\u8bf7\u6c42\uff0c\u5728 footer \u4e0b\u4e5f\u8981\u5bfc\u5165\u624d\u4f1a\u88ab\u7528\u5230\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">&lt;script src=&quot;{{ url_for('static', filename='js\/todo.js') }}&quot;&gt;&lt;\/script&gt;<\/pre><\/div>\n\n\n\n<p>\u5728\u524d\u7aef\u9875\u9762\u4e2d\uff0c\u521b\u5efa\u5b50\u8ba1\u5212\u7684\u4e3b\u8981\u4ee3\u7801\u5982\u4e0b\uff1a<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D6735\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div>\u8fd9\u91cc\u6211\u4eec\u6539\u53d8\u4e86\u8ba1\u5212\u7684\u72b6\u6001\u4e4b\u540e\uff0c\u8fd8\u53bb\u83b7\u53d6\u4e86\u300c\u5f53\u524d\u5927\u8ba1\u5212\u4e0b\u7684\u6240\u6709\u5b50\u8ba1\u5212\u6570\u91cf\u300d\u548c\u300c\u5f53\u524d\u5927\u8ba1\u5212\u4e0b\u7684\u5b8c\u6210\u7684\u8ba1\u5212\u6570\u91cf\u300d\uff0c\u7136\u540e\u8fd4\u56de\u3002<\/p>\n\n\n\n<p>\u90a3\u4e48\u8fd9\u65f6\u5019 js \u4e2d\u7684 data \u5c31\u53ef\u4ee5\u83b7\u53d6\u5230\u5b83\u4eec\uff0c\u7136\u540e\u628a\u5b83\u4eec\u66f4\u65b0\u5230 HTML \u4e2d\u53bb\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;python&quot;,&quot;mime&quot;:&quot;text\/x-python&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;wpum_restrict_type&quot;:&quot;wpum_restrict_type_state&quot;,&quot;wpum_hide_state_in&quot;:false,&quot;wpum_hide_state_out&quot;:false,&quot;language&quot;:&quot;Python&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;python&quot;}\">function onCheck(){\n    id = $(this).data(&quot;todo-id&quot;)\n    progressbarid = $(this).val()\n    $.post(&quot;\/todo\/change\/&quot;+id, function(data){\n        $(&quot;#progerssbar&quot; + progressbarid).attr('aria-valuenow', data.done)\n        $(&quot;#progerssbar&quot; + progressbarid).attr('aria-valuemax', data.all)\n     \t$(&quot;#progerssbar&quot; + progressbarid).attr('style', 'width: '+data.done\/data.all*100+'%')\n    });\n}<\/pre><\/div>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\uff0c\u901a\u8fc7 attr \u65b9\u6cd5\u53ef\u4ee5\u62ff\u5230\u5f53\u524d\u9875\u9762\u7684\u76f8\u5173\u5c5e\u6027\uff0c\u5e76\u66f4\u65b0\u65b0\u7684\u6570\u636e\uff0c\u90a3\u4e48\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4e00\u5f00\u59cb\u4f60\u770b\u5230\u7684\u8fdb\u5ea6\u6761\u66f4\u65b0\u4e86\u3002<\/p>\n\n\n\n<p>\u8fd9\u5c31\u662f\u5c40\u90e8\u5237\u65b0\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u4f60\u53ea\u8981\u6309\u7167\u4e0a\u9762\u8bf4\u7684\u5c40\u90e8\u5237\u65b0\u7684\u6d41\u7a0b\uff0c\u5c31\u53ef\u4ee5\u4e00\u6b65\u4e00\u6b65\u5b9e\u73b0\u5566\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f00\u53d1\u4f60\u7684\u9879\u76ee\u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u6709\u4e9b\u9875\u9762\u7684\u529f\u80fd\u53ea\u9700\u8981\u5237\u65b0\u5c40\u90e8\u6570\u636e\u5c31\u53ef\u4ee5\u4e86\uff0c\u4e0d\u9700\u8981\u6574\u4e2a\u9875\u9762\u90fd\u5237\u65b0\uff0c\u6bd4\u5982\u63a5\u4e0b\u6765\u6211\u8981\u7ed9\u4f60\u6f14\u793a\u7684\u8fd9\u4e2a\u300c\u8ba1\u5212\u529f\u80fd\u300d\uff1a \u5982\u4f55\u5b9e\u73b0\u5c40\u90e8\u5237\u65b0\uff1f \u50cf\u8fd9\u79cd\uff0c\u5728\u5927\u8ba1\u5212\u4e0b\u521b\u5efa\u76f8\u5173\u7684\u5c0f\u8ba1\u5212\uff0c\u4ee5\u53ca\u4efb\u52a1\u5b8c\u6210\u8fdb\u5ea6\u6761\u968f\u7740\u5c0f\u8ba1\u5212\u5b8c\u6210\u7684\u53d8\u5316\u7b49\u64cd\u4f5c\uff0c\u90fd\u662f\u9700\u8981\u5c06\u6570\u636e&hellip;<\/p>\n","protected":false},"author":1,"featured_media":6739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[99],"tags":[629,628,421,631,630],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6735"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6735"}],"version-history":[{"count":4,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6735\/revisions"}],"predecessor-version":[{"id":6741,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/6735\/revisions\/6741"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/media\/6739"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}