Allow translate.text to accept a string for callback in browser context
In the browser context, it is slightly more efficient (depending on the use case) for a user of translate.js to pass a string as the callback, which is the name of the global function that will be used when the jsonp request is complete. Besides that it is a nice additional feature I think.
efficient or succinct?
you'd have to show me the code, i dont really understand. if you are talking about event binding sugar syntax, i think thats the job for an event library, not translate
efficient or succinct?
efficient
you'd have to show me the code
It didn't turn out as well as I hoped, because the returned variable is the full reponse in this case, and not just the translated text..
yeah i see what you are talking about now.
this is a problem i think. if you fire two concurrent translate requests the callbacks are going to get borked?
this is why i wanted to use a standard JSONP / AJAX library for this. i might revert back to jQuery, since I know jQuery will automatically create the dynamic callback names for you.
this is a problem i think. if you fire two concurrent translate requests the callbacks are going to get borked?
I thought about that situation, and I can't see how this gets borked. A library would be overkill imo.