4 ms·
OMG LOL. Have they never heard about jQuery? Christ, they could have made the code so much more elegant.
by mschuster91 14y ago
OMG LOL. Have they never heard about jQuery? Christ, they could have made the code so much more elegant.
- jarek-foksa 14y agoTheir jQuery code would probably look like http://enterprise-js.com/23 http://enterprise-js.com/23, with aggressive caching methods used on all jQuery selectors: http://enterprise-js.com/27 http://enterprise-js.com/27
- deleted 14y ago[deleted]
- spoiler 14y agoWait, what? Why didn't I know about this website before? I am writing all these down!!!11oneoneone EOSarcasm
- phene 14y agoI hope you are kidding.
- recursive 14y agoSo you think they should inject a third-party dependency instead of just some inline js? And that would make it more elegant?
- mschuster91 14y agoThey could just inject it inline. No problem there. The whole document.write block 27-51 (possibly the CSS-block too, but I'm not sure about this) could be written far more elegant in jQuery. But the real saving is that "drag and drop" code - jQuery would abstract all that isIE/isNS crap from them.
- j79 14y agoOh man, I thought you were being sarcastic earlier!? ...unless you're still being sarcastic?
- mistercow 14y agoThe block of code they injected here was 7.9 KB (3.7 KB gzipped). jQuery is 93 KB (33 KB gzipped). So no, I don't think that would have been more elegant. Injecting anything into users' pages without permission is insane. Injecting a huge library like jQuery would be even more insane.
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- Aqueous 14y agoAs long as you're already injecting something, why not go all the way?
- dmak 14y agoWasted resources. The difference in size between the two (using the numbers from the above comment) is 85.1 KB. Now think of all the customers Comcast has and you will see quickly the difference it makes with a few KB.
- hayksaakian 14y agoright tool for the right job. a 1 page script written for comcast does not demand jQuery. That's not to say it would have improved it.
- mschuster91 14y agoIt at least would remove this damn ugly browser switching code. Hey, it's 2013, no need to reinvent the wheel...
- kyrias 14y agoBut think about the Netscape 6!
- spoiler 14y agojQuery would make this worse. It would be like adding a truck to be towed by a car that's running out of gas anyway.
- dmak 14y agoYou're missing the point. You're too focused on the code writing part. It's the extra unnecessary resources loaded from jQuery. The difference in size is 85.1 KB (according to an above post). 85.1 KB * 100,000,000 (Just an example of the number of times it is loaded) = 7.92555511 terabytes of wastes resources.
- STRML 14y ago-1 not enough jQuery
- NoodleIncident 14y agoI didn't know you could get downvoted this hard on HN... I had to select it to even read this!