trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Eval...why? #697

Open kprovance opened 10 years ago

kprovance commented 10 years ago

Is there any dire reason why the single eval statement is used or needed? I wanted to use this code in a wordpress theme, but Envato has strict rules about the use of eval. They do not allow it. So is it really needed? I notice it's the first part of try/catch, so could it be removed in my own build without affecting functionality?

stijnherreman commented 10 years ago

The code was added with https://github.com/trentrichardson/jQuery-Timepicker-Addon/commit/564348cd565faecf57bd32d0c6d2d48f46225880 and it came from https://github.com/vhochstein/jQuery-Timepicker-Addon/commit/ff849fca3ccba5426004947ec8ee37b34ea566b9 via https://github.com/trentrichardson/jQuery-Timepicker-Addon/pull/10

I don't see this documented anywhere, nor are there any tests for it. It's also invalid HTML5 and invalid HTML 4.01. So either this feature should be specced, documented and changed to use data- attributes, or it should be removed.