Grails 日历插件引发堆栈/递归错误
日历插件版本:当前版本 1.2.1
我按照 grails 插件文档中提到的步骤操作,在所有类型的浏览器 Chrome 14.0835 中都收到以下错误
:未捕获的 RangeError:超出了最大调用堆栈大小。
Firefox 6.02:递归过多 calendar.js 第 1851 行
IE 9:堆栈空间不足 calendar.js 第 1850 行
Calendar plugin version :CURRENT RELEASE 1.2.1
I followed steps as mentioned in the grails plugin documentation, I get the following error in all types of browser
Chrome 14.0835: Uncaught RangeError: Maximum Callstack size exceeded.
Firefox 6.02: Too much recursion calendar.js line 1851
IE 9: Out of stack space calendar.js line 1850
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有问题的 jscalendar 代码是这样的:
它重新定义了
Date.setFullYear()
。查看此“旧 jscalendar”页面上的评论 #124 和 #125。评论 #124(作者:Chris Lively)
建议更新 calendar.js(靠近底部,~第 1850 行)。
评论#125(拉里萨回复)
这两者都建议更新calendar.js,这并不理想,因为它是随插件一起提供的。
两个建议:
?如果是这样,请删除其中之一。The offending jscalendar code is this:
Which redefines
Date.setFullYear()
. Have a look at comments #124 and #125 on this "old jscalendar" page.Comment #124 (by Chris Lively)
Suggests updating calendar.js (near the bottom, ~line 1850).
Comment #125 (reply by larisa)
Both of these suggest updates to calendar.js, which isn't ideal since it's delivered with the plugin.
Two suggestions:
<calendar:resources/>
in your main layout and your view GSP? If so, remove one of them.这对我有用:
This works for me:
我解决这个问题的方法是
1)下载插件的源码
2)在本地创建同名插件。
3)将原始源文件复制到我创建的本地插件中
4)按照上面的建议更改了 javascript 文件
5)编译并打包插件
6)删除了我的主项目中的旧插件
7) 从第 5 步创建的 zip 文件中安装了新创建的插件。
它运行得非常好。
感谢 Rob Hruska 指出我在 javascript 文件中评论的位置
The way I resolved this issue is
1) Downloaded the source of the plugin
2) Created a plugin with the same name locally.
3) Copied the original source files to the local plugin I created
4) Changed the javascript file as suggested above
5) Compile and package the plugin
6) Removed the old plugin in my main project
7) Installed the newly created plugin from the zip file created from step 5.
It worked like a charm.
Thanks Rob Hruska for pointing me where to comment in the javascript file
我遇到了同样的问题,我已将
放置在我的主 jsp 以及在 jsp 中呈现的模板中。删除其中一个就解决了这个问题。I was facing same issue, I had placed
<calendar:resources/>
in my main jsp as well as in the template which was rendered in the jsp. Removing one of them solved the issue.