5 ms·
I am wondering what the 5 lines for MVP were. Anyone mind taking a shot?
by nrbafna 13y ago
I am wondering what the 5 lines for MVP were. Anyone mind taking a shot?
- matm 13y agoThis is referring to the integration code itself. It was something like: var DOMEvents = ['click', 'submit', 'change']; for (var i = 0; i < DOMEvents.length; i++) { window.addEventListener(DOMEvents[i], function(e){ $.post('/collector', {type: e.type, target_id: e.target.id, target_class: e.target.className}); }); }
- onion2k 13y agoThat's interesting and immediately obvious how it could both be useful and valuable in the right domain. Logging what people are doing on modern event-driven websites definitely is a problem worth solving. My let's-made-a-complicated-version-first mindset would have extended jQuery's .bind or .on prototype in case the site is using event.stopPropagation(), and that's why I never finish anything. Thanks for sharing.
- shamsulbuddy 12y agoThis is rocksolid basic script..one quick question..if you post on every event then dont you think so that it will generate huge traffic..how did you handle that