{"action":"created","issue":{"url":"https://api.github.com/repos/progrape/router/issues/17","repository_url":"https://api.github.com/repos/progrape/router","labels_url":"https://api.github.com/repos/progrape/router/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/progrape/router/issues/17/comments","events_url":"https://api.github.com/repos/progrape/router/issues/17/events","html_url":"https://github.com/progrape/router/issues/17","id":158398969,"number":17,"title":"我希望在一个页面render之前请求一下数据","user":{"login":"xhacker5000","id":3337287,"avatar_url":"https://avatars.githubusercontent.com/u/3337287?v=3","gravatar_id":"","url":"https://api.github.com/users/xhacker5000","html_url":"https://github.com/xhacker5000","followers_url":"https://api.github.com/users/xhacker5000/followers","following_url":"https://api.github.com/users/xhacker5000/following{/other_user}","gists_url":"https://api.github.com/users/xhacker5000/gists{/gist_id}","starred_url":"https://api.github.com/users/xhacker5000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xhacker5000/subscriptions","organizations_url":"https://api.github.com/users/xhacker5000/orgs","repos_url":"https://api.github.com/users/xhacker5000/repos","events_url":"https://api.github.com/users/xhacker5000/events{/privacy}","received_events_url":"https://api.github.com/users/xhacker5000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-03T15:55:42Z","updated_at":"2016-06-14T03:57:17Z","closed_at":null,"body":"是不是可以写成这样\r\n\r\n```javascript\r\n// button\r\n    var button = {\r\n        url: '/button',\r\n        className: 'button',\r\n        render: function () {\r\n            \r\n            //do something query\r\n            xxxx.query();\r\n            return $('#tpl_button').html();\r\n        }\r\n    };\r\n```"},"comment":{"url":"https://api.github.com/repos/progrape/router/issues/comments/225773812","html_url":"https://github.com/progrape/router/issues/17#issuecomment-225773812","issue_url":"https://api.github.com/repos/progrape/router/issues/17","id":225773812,"user":{"login":"zouzhenxing","id":16457664,"avatar_url":"https://avatars.githubusercontent.com/u/16457664?v=3","gravatar_id":"","url":"https://api.github.com/users/zouzhenxing","html_url":"https://github.com/zouzhenxing","followers_url":"https://api.github.com/users/zouzhenxing/followers","following_url":"https://api.github.com/users/zouzhenxing/following{/other_user}","gists_url":"https://api.github.com/users/zouzhenxing/gists{/gist_id}","starred_url":"https://api.github.com/users/zouzhenxing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zouzhenxing/subscriptions","organizations_url":"https://api.github.com/users/zouzhenxing/orgs","repos_url":"https://api.github.com/users/zouzhenxing/repos","events_url":"https://api.github.com/users/zouzhenxing/events{/privacy}","received_events_url":"https://api.github.com/users/zouzhenxing/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T03:57:17Z","updated_at":"2016-06-14T03:57:17Z","body":"```\r\nvar button = {\r\n        url: '/button',\r\n        className: 'button',\r\n        render: function () {\r\n            //使用JQuery deferred对象\r\n            var d = $.Deferred();\r\n            $.ajax(...).done(function( data ){\r\n                   var html = ejs.render($('#tpl_button').html(),{data:data});\r\n                   d.resolve(html);\r\n            });\r\n            return d.promise();\r\n        }\r\n };\r\n```"}}
{"actor":{"display_login":"zouzhenxing"}}