{"comment":{"url":"https://api.github.com/repos/WPAFC/afch-rewrite/comments/9213235","html_url":"https://github.com/WPAFC/afch-rewrite/commit/1c620a5d5c37e13fa965f8383e5ded7a151459da#commitcomment-9213235","id":9213235,"user":{"login":"theopolisme","id":1410202,"avatar_url":"https://avatars.githubusercontent.com/u/1410202?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolisme","html_url":"https://github.com/theopolisme","followers_url":"https://api.github.com/users/theopolisme/followers","following_url":"https://api.github.com/users/theopolisme/following{/other_user}","gists_url":"https://api.github.com/users/theopolisme/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolisme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolisme/subscriptions","organizations_url":"https://api.github.com/users/theopolisme/orgs","repos_url":"https://api.github.com/users/theopolisme/repos","events_url":"https://api.github.com/users/theopolisme/events{/privacy}","received_events_url":"https://api.github.com/users/theopolisme/received_events","type":"User","site_admin":false},"position":31,"line":1406,"path":"src/modules/core.js","commit_id":"1c620a5d5c37e13fa965f8383e5ded7a151459da","created_at":"2015-01-09T03:14:18Z","updated_at":"2015-01-09T03:14:18Z","body":"Based on the way JavaScript closures work, you can just use a variable to refer to the `<span>`, so (simple example incoming...)\r\n\r\n```js\r\nvar $thingy = $('<span>').appendTo(linkSpan);\r\n\r\napiCall.done( function () {\r\n  // can refer to thingy here\r\n  $thingy.text( 'yay!' );\r\n}\r\n```\r\n\r\nThis avoids having to assign unique ids and all that mess."}}