{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/87","repository_url":"https://api.github.com/repos/balderdashy/sails.io.js","labels_url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/87/comments","events_url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/87/events","html_url":"https://github.com/balderdashy/sails.io.js/pull/87","id":132221580,"number":87,"title":"Support for setting `io.sails` config using HTML attributes on the <script> tag that brought in the library.","user":{"login":"mikermcneil","id":618009,"avatar_url":"https://avatars.githubusercontent.com/u/618009?v=3","gravatar_id":"","url":"https://api.github.com/users/mikermcneil","html_url":"https://github.com/mikermcneil","followers_url":"https://api.github.com/users/mikermcneil/followers","following_url":"https://api.github.com/users/mikermcneil/following{/other_user}","gists_url":"https://api.github.com/users/mikermcneil/gists{/gist_id}","starred_url":"https://api.github.com/users/mikermcneil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikermcneil/subscriptions","organizations_url":"https://api.github.com/users/mikermcneil/orgs","repos_url":"https://api.github.com/users/mikermcneil/repos","events_url":"https://api.github.com/users/mikermcneil/events{/privacy}","received_events_url":"https://api.github.com/users/mikermcneil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-08T18:25:03Z","updated_at":"2016-02-08T22:09:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/balderdashy/sails.io.js/pulls/87","html_url":"https://github.com/balderdashy/sails.io.js/pull/87","diff_url":"https://github.com/balderdashy/sails.io.js/pull/87.diff","patch_url":"https://github.com/balderdashy/sails.io.js/pull/87.patch"},"body":"Instead of:\r\n\r\n```html\r\n<script src=\"/js/dependencies/sails.io.js\"></script>\r\n<script type=\"text/javascript\">\r\n  io.sails.headers = {\r\n    'x-csrf-token': <%- typeof _csrf !== 'undefined' ? JSON.stringify(_csrf) : 'null' %>\r\n  };\r\n</script>\r\n```\r\n\r\n\r\nYou can do:\r\n```\r\n<script src=\"/js/dependencies/sails.io.js\" headers='{\"x-csrf-token\":<%- typeof _csrf !== 'undefined' ? JSON.stringify(_csrf) : 'null' %>}'></script>\r\n```\r\n(allowing you to avoid tricky issues with script tag order, as well as avoiding the inline code)\r\n\r\n\r\n\r\nCurrently supports `autoConnect`, `environment`, and `headers`.\r\n\r\n\r\n========================\r\n\r\nBefore bringing this in, we need to:\r\n- test this more\r\n- update socket client reference docs\r\n- do a search in sails-docs for anywhere else mentioning io.sails and make sure this is mentioned\r\n"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/comments/181590337","html_url":"https://github.com/balderdashy/sails.io.js/pull/87#issuecomment-181590337","issue_url":"https://api.github.com/repos/balderdashy/sails.io.js/issues/87","id":181590337,"user":{"login":"luislobo","id":453120,"avatar_url":"https://avatars.githubusercontent.com/u/453120?v=3","gravatar_id":"","url":"https://api.github.com/users/luislobo","html_url":"https://github.com/luislobo","followers_url":"https://api.github.com/users/luislobo/followers","following_url":"https://api.github.com/users/luislobo/following{/other_user}","gists_url":"https://api.github.com/users/luislobo/gists{/gist_id}","starred_url":"https://api.github.com/users/luislobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luislobo/subscriptions","organizations_url":"https://api.github.com/users/luislobo/orgs","repos_url":"https://api.github.com/users/luislobo/repos","events_url":"https://api.github.com/users/luislobo/events{/privacy}","received_events_url":"https://api.github.com/users/luislobo/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T22:09:11Z","updated_at":"2016-02-08T22:09:11Z","body":"what about making the attributes prefixed by data- ? \r\nhttps://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes"}}