【问题标题】:How do I use the latest version of jQuery and get back the '$' for jQuery in RichFaces?如何使用最新版本的 jQuery 并在 RichFaces 中取回 jQuery 的“$”?
【发布时间】:2011-04-22 08:52:48
【问题描述】:

RichFaces 3.3.3 包含在 jQuery 1.3.2 以及原型和 scriptaculous 中。

如何尝试使用最新版本的 jQuery? 我可以使用 Google CDN 吗?

此外,$() 对象默认为 prorotype 并且要使用 jQuery,我必须这样做 jQuery()

有没有办法在不破坏 RichFaces 的情况下为 jQuery 取回 $?

更新: 您可以并排使用多个版本的 jQuery。现在,我继续使用 RichFaces 自带的版本。

【问题讨论】:

  • 如何使用 RichFaces 附带的版本。我的问题是我在 JSF 中使用 Jquery。我没有使用 组件。它如何自动读取即使不使用richFaces提供的jQuery组件,js文件也是如此。

标签: jquery jsp jsf richfaces facelets


【解决方案1】:

通过以这种方式包装 jQuery 代码,您可以在不破坏 RichFaces 的情况下将 $ 与 jQuery 一起使用:

(function($) {
  /* your jQuery code can use $() here */
})(jQuery);

【讨论】:

    猜你喜欢
    • 2011-12-01
    • 2018-05-18
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    • 2014-05-05
    • 1970-01-01
    • 1970-01-01
    • 2012-09-18
    相关资源
    最近更新 更多