添加struts2-jquery-plugin标签声明时JCarousel无法正确显示
我正在使用 struts2 jquery 插件 2.5.1 和 jcarousel 0.2.7。
JCarousel 工作正常,但一旦我添加 <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
它就无法正确渲染,仅显示为UL LI 列表。
我猜测这可能是 struts2 jquery 插件和 之间的某种冲突;
JCarousel 需要定义,但我不知道。
任何人都可以提出任何建议吗?
谢谢。
I'm using struts2 jquery plugin 2.5.1 and jcarousel 0.2.7.
The JCarousel works properly but as soon as I add <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
it fails to render properly and is just displayed as a list of UL LI's.
I'm guessing it might be some sort of collision between the struts2 jquery plugin and the <script type="text/javascript" src="jquery-1.4.3.min.js"></script>
definition needed for the JCarousel but I have no clue.
Anyone can suggest anything?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用 S2 jquery 插件。
相反,寻找模板解决方案,尽管乍一看似乎更复杂。一个好的模板系统将减少大型网站的大量工作并带来回报。然后将不显眼的 javascript/jquery 应用到您的工作中。 Apache Tiles2 和 Sitemesh 很流行,我使用 Tiles。
S2 Dojo 标签已被弃用,不是因为 dojo 的缺陷,而是因为 ajax 标签库的缺陷。它们为组件添加了额外的抽象级别,使其更加脆弱。如果您需要提供 JS 函数作为参数,它们会强制在 JSP 中混合 JS(侵入式)。他们将落后并提供所有现有组件的一小部分。
当标签库做你需要它做的事情时,它可能是一个更快的解决方案......而且只是非常轻微,因为它们只是 jquery 插件的非常薄的包装,但是一旦你需要它做更多的事情,你就会有使用直接 jQuery 会更好。
Don't use the S2 jquery plugin.
Instead look for a template solution although it seems more complicated at first. A good template system will reduce a lot of work for larger sites and pay it self off. Then apply unobtrusive javascript/jquery to your work. Apache Tiles2 and Sitemesh are popular, I use Tiles.
The S2 Dojo tags have been deprecated, not because of a short coming in dojo but because of a short coming in ajax tag libraries. They add an extra level of abstraction to a component making it more brittle. If you need to provide a JS function as an argument they force the mixing of JS within the JSP (intrusive). They are going to lag behind and provide a small subset of all the components that are out there.
When a tag lib does what you need it to, it might be a faster solution... and only very slightly so because they are just very thin wrapper over jquery plug-ins but once you need it to do something more you'd have been better off with straight jQuery.