jQuery UI 日期选择器中的静默错误
我遇到了一个非常奇怪的问题。
我正在构建一个报告包,其中一部分使用 daterangepicker 库来,嗯,选择一个日期范围。但是,在创建所有内容的函数期间,一旦到达创建调用 $("#date-range-picker").daterangepicker(options)
,它就会停止。经过一段时间跟踪 daterangepicker、jQuery 和 jQueryUI 的调用后,我发现对 new Date() 的调用失败,并出现错误 RangeError: Maximum call stack size gone
,看起来里面的代码只是存储了错误并且仍然认为它是一个 Date 对象。
我测试了在脚本暂停时创建一个新日期,并导致了相同的错误。 一旦脚本失败,就会发生同样的错误。但不是在脚本开始之前。
更新:我发现了问题,这是 daterangepicker 脚本包含的重复。
I have encountered a very strange problem.
I am building a reporting package and part of it uses the daterangepicker library to, well, pick a date range. However, during the function that creates everything, it just stops once it gets to the creation call $("#date-range-picker").daterangepicker(options)
. After some time tracing the calls through daterangepicker, jQuery, and jQueryUI, I discover that a call to new Date()
is failing with the error RangeError: Maximum call stack size exceeded
, and it seems that the code inside just stores the error and still thinks its a Date object.
I tested creating a new date while the script was paused there and it caused the same error.
The same error happens once the script has fails. But not before the script starts.
UPDATE: I found the problem, it was a repetition of the daterangepicker script include.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在同一页面多次使用日期选择器,请为日期选择器使用动态 ID。
use dynamic IDs for datepicker if you use datepicker more than one time at same page.