{"id":792,"date":"2012-04-26T23:32:56","date_gmt":"2012-04-26T23:32:56","guid":{"rendered":"http:\/\/brain.dailyon.net\/?p=792"},"modified":"2012-04-26T23:32:56","modified_gmt":"2012-04-26T23:32:56","slug":"jquery-data%ec%9d%98-%ec%95%94%eb%ac%b5%ec%a0%81%ec%9d%b8-%ec%9d%b4%eb%b2%a4%ed%8a%b8-setdata-getdata","status":"publish","type":"post","link":"https:\/\/blog.goorigo.com\/?p=792","title":{"rendered":"jQuery : data()\uc758 \uc554\ubb35\uc801\uc778 \uc774\ubca4\ud2b8 setData, getData"},"content":{"rendered":"<p><code><\/p>\n<p><title>data\uba54\uc11c\ub4dc\uc758 \uc554\ubb35\uc801 \uc774\ubca4\ud2b8<\/title><\/p>\n<p>$(document).bind('setData', function(evt, key, value){<br \/>\n\tif( key == 'clock'){<br \/>\n\t\t$('.updateTime').html(value);<br \/>\n\t}<br \/>\n});<\/p>\n<p>var interval;<br \/>\nfunction start(){<br \/>\n\tinterval = setInterval(function(){<br \/>\n\t\t$(document).data('clock', (new Date()).toString() );<br \/>\n\t}, 1000);<br \/>\n}<\/p>\n<p>function cancel(){<br \/>\n\tclearInterval(interval);<br \/>\n}<\/p>\n<p>\n\tdata\uba54\uc11c\ub4dc\uac00 \uc2e4\ud589\ud560\ub54c\ub9c8\ub2e4 setData getData \uc774\ubca4\ud2b8\uac00 \ubc1c\uc0dd\ud55c\ub2e4.<br \/>\n\tAjax\uc73c\ub85c \ubc1b\uc544\uc628 \ub370\uc774\ud130\ub97c \uc751\uc6a9\ud558\uba74 \uc2e4\uc2dc\uac04\uc73c\ub85c UI \ubc18\uc601\ud558\uac8c \ud558\ub294 \ud615\ud0dc\ub85c \ub9cc\ub4e4\uc218\uc788\ub2e4.<\/p>\n<p>\t<button>\uc2dc\uc791<\/button><br \/>\n\t<button>\uc911\uc9c0<\/button><br \/>\n\t<br \/>\n\t<span class=\"updateTime\">Time Zone<\/span><\/p>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>data\uba54\uc11c\ub4dc\uc758 \uc554\ubb35\uc801 \uc774\ubca4\ud2b8 $(document).bind(&#8216;setData&#8217;, function(evt, key, value){ if( key == &#8216;clock&#8217;){ $(&#8216;.updateTime&#8217;).html(value); } }); var interval; function start(){ interval = setInterval(function(){ $(document).data(&#8216;clock&#8217;, (new Date()).toString() ); }, 1000); } function cancel(){&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/792"}],"collection":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=792"}],"version-history":[{"count":0,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/792\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}