{"id":88151,"date":"2020-02-07T07:03:27","date_gmt":"2020-02-06T23:03:27","guid":{"rendered":"http:\/\/4563.org\/?p=88151"},"modified":"2020-02-07T07:03:27","modified_gmt":"2020-02-06T23:03:27","slug":"%e6%9c%89%e4%bb%80%e4%b9%88%e6%96%b9%e5%bc%8f%ef%bc%8c%e5%8f%af%e4%bb%a5-clearintervalmyvar-%e6%b8%85%e9%99%a4%e5%8f%a6%e5%a4%96%e4%b8%80%e4%b8%aa%e5%87%bd%e6%95%b0%e9%87%8c%e7%9a%84%e5%ae%9a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=88151","title":{"rendered":"\u6709\u4ec0\u4e48\u65b9\u5f0f\uff0c\u53ef\u4ee5 clearInterval(myVar); \u6e05\u9664\u53e6\u5916\u4e00\u4e2a\u51fd\u6570\u91cc\u7684\u5b9a\u65f6\u5668 myVar \u5417\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u4ec0\u4e48\u65b9\u5f0f\uff0c\u53ef\u4ee5 clearInterval(myVar); \u6e05\u9664\u53e6\u5916\u4e00\u4e2a\u51fd\u6570\u91cc\u7684\u5b9a\u65f6\u5668 myVar \u5417\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lisisi <\/span>  <span><i><\/i> 16<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u9875\u9762\u91cc\u6709\u4e00\u4e2a\u5b9a\u65f6\u5668 myVar\uff0c\u7528\u6237\u70b9\u51fb\u67d0\u4e2a\u6309\u94ae\u7684 onclick \u4e8b\u4ef6 sending() \u65f6\uff0c\u6e05\u9664\u5b9a\u65f6\u5668 myVar \u3002 \u4e24\u4e2a script \u4e0d\u5728\u4e00\u8d77\uff0c\u6709\u4ec0\u4e48\u65b9\u5f0f\u53ef\u4ee5\u5728 sending() \u91cc\uff0c\u6e05\u9664 myVar \u5417\uff1f<\/p>\n<pre><code>&lt;a class=\"btn btn-default\" href=\"javascript:void(0);\" role=\"button\" onclick=\"sending()\"&gt;Send&lt;\/a&gt;  &lt;script type=\"text\/javascript\"&gt;     var myVar = setInterval(function(){ myTimer() }, 1000);          function myTimer() {         var d = new Date();         console.log(d);     } &lt;\/script&gt;  &lt;script type=\"text\/javascript\"&gt;     function sending() {         \/\/ do something...         clearInterval(myVar);     } &lt;\/script&gt;  <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1132248\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : explore365 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             window.myVar = ***                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1132249\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yafoo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9ed8\u8ba4\u5c31\u53ef\u4ee5\u6e05\u695a\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1132250\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kimjosda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             script \u6807\u7b7e\u5bfc\u5165\u7684 js \u4ee3\u7801\u90fd\u662f\u4f5c\u7528\u5728\u5168\u5c40\u4f5c\u7528\u57df\u7684\uff0c\u6240\u4ee5\u5206\u5728\u4e24\u4e2a script \u91cc\u5199\u548c\u4e00\u4e2a\u6ca1\u533a\u522b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1132251\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kimjosda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u4e2a\u5730\u65b9\u8bf4\u9519\u4e86\uff0c\u5e94\u8be5\u662f script \u6807\u7b7e\u5bfc\u5165\u7684 js \u811a\u672c\u6587\u4ef6\uff0c\u4e0d\u662f\u6240\u6709\u7684 js \u4ee3\u7801                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4ec0\u4e48\u65b9\u5f0f\uff0c\u53ef\u4ee5 clearInt&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/88151"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=88151"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/88151\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88151"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}