Timeline for Duplication of code (backend and javascript - knockout)
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 8, 2015 at 11:16 | comment | added | Jason | @MichalB. But you're only talking about HTTP requests, which if done with AJAX/JSON - should be cached and light. In return, you get to sleep at night knowing your super complex code doesn't have a mistake somewhere in the javascript - or between the two implementations - and producing problems. As someone else mentioned, use onblur or a timeout to reduce the AJAX calls (in Knockout, this is a parameter). A small request to a controller isn't taxing to a webserver. | |
| Nov 20, 2012 at 19:55 | history | edited | kevin cline | CC BY-SA 3.0 |
deleted 1 characters in body
|
| Nov 20, 2012 at 14:28 | comment | added | Michal B. | Seems like a lot of work to achieve something that can be easily achieved client side... | |
| Nov 20, 2012 at 12:47 | comment | added | user281377 | To avoid creating too many ajax requests, start a timeout with something like 300ms; if another keystroke happens till then, clear and restart the timeout again. Once the timeout happens, launch the AJAX request. Obviously, it depends on the number of concurrent users how many AJAX requests are too many. | |
| Nov 20, 2012 at 11:46 | comment | added | Michal B. | In my case the formula cannot change. But I get your point. AJAX request after each key press seems more of a headache to me though... | |
| Nov 20, 2012 at 11:37 | history | answered | user281377 | CC BY-SA 3.0 |