{"id":338,"date":"2015-12-01T09:42:13","date_gmt":"2015-12-01T01:42:13","guid":{"rendered":"http:\/\/www.codeeel.com\/?p=338"},"modified":"2015-12-01T09:57:41","modified_gmt":"2015-12-01T01:57:41","slug":"%e5%be%ae%e4%bf%a1%e9%87%8c%e5%a6%82%e4%bd%95%e5%88%a4%e6%96%ad%e9%a1%b5%e9%9d%a2%e8%a2%ab%e5%88%86%e4%ba%ab%e6%88%90%e5%8a%9f%ef%bc%8c%e5%9b%9e%e8%b0%83%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.codeeel.com\/?p=338","title":{"rendered":"\u5fae\u4fe1\u91cc\u5982\u4f55\u5224\u65ad\u9875\u9762\u88ab\u5206\u4eab\u6210\u529f\uff0c\u56de\u8c03\u5904\u7406"},"content":{"rendered":"<pre class=\"hljs javascript\">\r\nvar shareData = {\r\n    img_url: \"\",\r\n    img_width: 200,\r\n    img_height: 200,\r\n    link: '',\r\n    desc: '',\r\n    title: '',\r\n    appid: 0\r\n};\r\n\r\ndocument.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {\r\n    \/\/ \u53d1\u9001\u7ed9\u597d\u53cb\r\n    WeixinJSBridge.on('menu:share:appmessage', function(argv){\r\n        shareFriend();\r\n    });\r\n    \/\/ \u5206\u4eab\u5230\u670b\u53cb\u5708\r\n    WeixinJSBridge.on('menu:share:timeline', function(argv){\r\n        shareTimeline();\r\n    }); \r\n}, false);\r\n\r\n\r\nfunction shareTimeline() {\r\n    WeixinJSBridge.invoke('shareTimeline', shareData, function(res) {\r\n        validateShare(res);\r\n        _report('timeline', res.err_msg);\r\n    });\r\n}\r\n\r\nfunction shareFriend() {\r\n    WeixinJSBridge.invoke('sendAppMessage', shareData, function(res) {\r\n        validateShare(res);\r\n        _report('send_msg', res.err_msg);\r\n    });\r\n}\r\n\r\nfunction validateShare(res) {\r\n    if(res.err_msg != 'send_app_msg:cancel' &amp;&amp; res.err_msg != 'share_timeline:cancel') {\r\n    \/\/\u5206\u4eab\u5b8c\u6bd5\u56de\u8c03\r\n    }\r\n}\r\n\r\n<\/pre>\n<p>\u8fd9\u6837\u5927\u5bb6\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u56de\u8c03\u8fdb\u884c\uff0c\u4fa6\u6d4b\u4e0a\u4f20\u670d\u52a1\u7aef\u5566<\/p>\n","protected":false},"excerpt":{"rendered":"<p>var shareData = { img_url: &#8220;&#8221;, img_width: 200, img_height: 200, link: &#8221;, desc: &#8221;, title: &#8221;, appid: 0 }; document.addEventListener(&#8216;WeixinJSBridgeReady&#8217;, func<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20,14],"tags":[166,165,164],"_links":{"self":[{"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/posts\/338"}],"collection":[{"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=338"}],"version-history":[{"count":2,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=\/wp\/v2\/posts\/338\/revisions\/341"}],"wp:attachment":[{"href":"https:\/\/www.codeeel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codeeel.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}