[richfaces-issues] [JBoss JIRA] (RF-12936) Use jQuery in non-conflicting way

Brian Leathem (JIRA) jira-events at lists.jboss.org
Thu Jul 4 19:15:22 EDT 2013


     [ https://issues.jboss.org/browse/RF-12936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-12936:
-------------------------------

     Original Estimate: 1 hour
    Remaining Estimate: 1 hour

    
> Use jQuery in non-conflicting way
> ---------------------------------
>
>                 Key: RF-12936
>                 URL: https://issues.jboss.org/browse/RF-12936
>             Project: RichFaces
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: core
>    Affects Versions: 4.3.1
>            Reporter: Lukáš Fryč
>             Fix For: 5.0.0.Alpha2
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> The {{richfaces.js}} references both, {{jQuery}} from closure and global {{$}} - this issue is addressed in RF-12833.
> However jQuery should not be used directly, rather from closures - prefered way is to use {{$}} but its naming now conflicts with {{RichFaces.$}} for component references.
> I suggest to use following trick:
> {code:title=richfaces.js}
> RichFaces.jQuery = RichFaces.jQuery || jQuery;
> //encapsulation
> (function($, RichFaces) {
>     // free to use $ here
> }(RichFaces.jQuery, RichFaces));
> {code}
> It will allow:
> * provide own jQuery for RichFaces
> * use libraries which make use of {{$}} (prototype, other jQuery versions) in no-conflicting way

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list