Drupal 5.0 will include the fab JavaScript library jQuery. But where does that leave us poor slobs who need to develop on 4.7? Out in the cold, that's where. Sadly, Drupal 4.7's own JavaScript package conflicts with jQuery in a number of places, preventing easy including of the jQuery library in contributed modules. Enter jquery47, a slightly hacked version of jQuery, compatible with Drupal's own JS files. By invoking jquery_add_js('path/to/your/file.js') you can reap the benefits of jQuery while wrapped warmly in the bosom of Drupal 4.7 First, a note: to make jQuery compatible with Drupal, I had to rename the $ function to JQ. Sorry, there's really no way around this. When Drupal 5.0 comes out, you'll have to rename all your calls to JQ('...') to $('...'). Write your JS file and put it somewhere. Using drupal_get_path() get your file's path. Call jquery_add_js($yourfilepath) and you're ready to go. In addition to the jquery47.module, there is also two versions of the modified jQuery library. The normal human readable version for you to see what crimes I committed agains the jQuery library, and a compressed version to save you bandwidth $$$. This module will be deprecated in Drupal 5.0 (thank god). Use at your own risk until then.
jQuery - отличная штука. Неужто для связи с Drupal надо как-то по-особенному?
У меня получается спокойно её сращивать с wordpress-ом. Думаю, что и Drupal особых проблем быть недолжно, ибо программируется jQuery на удивление легко. Я вот кропаю уроки по ней. По сути любая "проблема" решается в несколько строк кода. Если любопытно - посмотрите
Комментарии
Че-то не понял, что это за штуковина...
а можно этот jQuery проверить и на 4.7.x версии, есть модуль
jQuery 4.7
Utility · Modules
mfredrickson - November 6, 2006 - 22:10
Drupal 5.0 will include the fab JavaScript library jQuery. But where does that leave us poor slobs who need to develop on 4.7? Out in the cold, that's where. Sadly, Drupal 4.7's own JavaScript package conflicts with jQuery in a number of places, preventing easy including of the jQuery library in contributed modules. Enter jquery47, a slightly hacked version of jQuery, compatible with Drupal's own JS files. By invoking jquery_add_js('path/to/your/file.js') you can reap the benefits of jQuery while wrapped warmly in the bosom of Drupal 4.7 First, a note: to make jQuery compatible with Drupal, I had to rename the $ function to JQ. Sorry, there's really no way around this. When Drupal 5.0 comes out, you'll have to rename all your calls to JQ('...') to $('...'). Write your JS file and put it somewhere. Using drupal_get_path() get your file's path. Call jquery_add_js($yourfilepath) and you're ready to go. In addition to the jquery47.module, there is also two versions of the modified jQuery library. The normal human readable version for you to see what crimes I committed agains the jQuery library, and a compressed version to save you bandwidth $$$. This module will be deprecated in Drupal 5.0 (thank god). Use at your own risk until then.
Releases [http://ftp.osuosl.org/pub/drupal/files/projects/jquery47-4.7.0.tar.gz]
Страничка модуля:
http://drupal.org/project/jquery47
Вы бы поменяли на главной странице версию на 4.7.4
бета 5.0 вышла
форум не работает
jQuery - отличная штука. Неужто для связи с Drupal надо как-то по-особенному?
У меня получается спокойно её сращивать с wordpress-ом. Думаю, что и Drupal особых проблем быть недолжно, ибо программируется jQuery на удивление легко. Я вот кропаю уроки по ней. По сути любая "проблема" решается в несколько строк кода. Если любопытно - посмотрите