You are here

README.txt in jQuery Multi 6

Same filename and directory in other branches
  1. 7 README.txt
////////////////////////////////////////////
//
//  jQuery Multi
//
////////////////////////////////////////////

-- SUMMARY --

Need to use a higher version of jQuery for your module or theme than the one provided by Drupal/jQuery Update?

jQuery Multi allows you to load an extra version of the jQuery library in parallel to Drupal's version, without 
conflicting with Drupal's version. You can then choose any JavaScript library or files to use the new version
of jQuery. No need to alter packaged jQuery plugins!

-- INSTALLATION --

  1. Place a version of the minified jQuery library in the libraries folder, so that
     the path to the actual jQuery library will be: sites/all/libraries/jquery/jquery-<version>.min.js
  2. Download and install jQuery Multi in the usual fashion.

-- USAGE --

  1. Enable the module.
  2. Navigate to the settings page at admin/settings/jqmulti.
  3. Ensure that your jQuery library has been detected.
  
  4. To target certain JavaScript files to run with the jQuery Multi version, choose
     one of the following methods (Methods A-C do not require changing any JS, and so are
     ideal when using a prepackaged jQuery library):
  
    NOTE:  If you want the library or files to load on every page load, use the 'Always load libraries
           and files' option. Otherwise you must load them explicitly using drupal_add_js() or a similar method.
  
    A) Put the JS in sites/all/libraries/ and use the UI at admin/settings/jqmulti
       to target your library to jqmulti. There is no need to use the alias in this case.
    B) Put the JS in sites/all/libraries/ and use hook_jqmulti_libraries() to target the library.
       No need to use the alias. This is equivalent to method A.
    C) Put the JS anywhere else, like in a custom module, and target it using hook_jqmulti_files(). No need to use the alias.
    D) Put the JS anywhere and target it using the provided alias. Don't use the jqmulti hooks or UI.
       If you're only using this method, make sure to select the 'Always load jQuery' checkbox in the jQuery Multi config.

        To use the automatically provided jQuery alias in your custom scripts:
  
            Use the version of jQuery loaded by jQuery Multi in your custom scripts by referencing
            the automatically provided alias in your script closure. The alias names are
            generated using the jQuery version number, with the periods removed.
  
            For instance, if you're loading jQuery-1.7.1, the alias will be jq171, and you can
            use it in your scripts by wrapping your code as follows:
  
            (function($){
              // your code here, using jQuery 1.7.1
            })(jq171)
    
  NOTE: Loading libraries with Jquery Multi will only load the JS files within the library. You must
        call drupal_add_css() separately to load any included CSS files that may be in the library.

  NOTE: All jQuery targeted to use jQuery Multi (using methods A, B, or C above) must properly use a 
        closure around the jQuery code, as is best practice for all Drupal jQuery code, i.e.:
        
            (function($){
              // your code here, using jQuery 1.7.1
            })(jQuery)

File

README.txt
View source
  1. ////////////////////////////////////////////
  2. //
  3. // jQuery Multi
  4. //
  5. ////////////////////////////////////////////
  6. -- SUMMARY --
  7. Need to use a higher version of jQuery for your module or theme than the one provided by Drupal/jQuery Update?
  8. jQuery Multi allows you to load an extra version of the jQuery library in parallel to Drupal's version, without
  9. conflicting with Drupal's version. You can then choose any JavaScript library or files to use the new version
  10. of jQuery. No need to alter packaged jQuery plugins!
  11. -- INSTALLATION --
  12. 1. Place a version of the minified jQuery library in the libraries folder, so that
  13. the path to the actual jQuery library will be: sites/all/libraries/jquery/jquery-.min.js
  14. 2. Download and install jQuery Multi in the usual fashion.
  15. -- USAGE --
  16. 1. Enable the module.
  17. 2. Navigate to the settings page at admin/settings/jqmulti.
  18. 3. Ensure that your jQuery library has been detected.
  19. 4. To target certain JavaScript files to run with the jQuery Multi version, choose
  20. one of the following methods (Methods A-C do not require changing any JS, and so are
  21. ideal when using a prepackaged jQuery library):
  22. NOTE: If you want the library or files to load on every page load, use the 'Always load libraries
  23. and files' option. Otherwise you must load them explicitly using drupal_add_js() or a similar method.
  24. A) Put the JS in sites/all/libraries/ and use the UI at admin/settings/jqmulti
  25. to target your library to jqmulti. There is no need to use the alias in this case.
  26. B) Put the JS in sites/all/libraries/ and use hook_jqmulti_libraries() to target the library.
  27. No need to use the alias. This is equivalent to method A.
  28. C) Put the JS anywhere else, like in a custom module, and target it using hook_jqmulti_files(). No need to use the alias.
  29. D) Put the JS anywhere and target it using the provided alias. Don't use the jqmulti hooks or UI.
  30. If you're only using this method, make sure to select the 'Always load jQuery' checkbox in the jQuery Multi config.
  31. To use the automatically provided jQuery alias in your custom scripts:
  32. Use the version of jQuery loaded by jQuery Multi in your custom scripts by referencing
  33. the automatically provided alias in your script closure. The alias names are
  34. generated using the jQuery version number, with the periods removed.
  35. For instance, if you're loading jQuery-1.7.1, the alias will be jq171, and you can
  36. use it in your scripts by wrapping your code as follows:
  37. (function($){
  38. // your code here, using jQuery 1.7.1
  39. })(jq171)
  40. NOTE: Loading libraries with Jquery Multi will only load the JS files within the library. You must
  41. call drupal_add_css() separately to load any included CSS files that may be in the library.
  42. NOTE: All jQuery targeted to use jQuery Multi (using methods A, B, or C above) must properly use a
  43. closure around the jQuery code, as is best practice for all Drupal jQuery code, i.e.:
  44. (function($){
  45. // your code here, using jQuery 1.7.1
  46. })(jQuery)