jQuery

firebus's picture

Including external javascript files in drupal 6

In D7, drupal_add_js can handle external javascript files, but in D6 it cannot handle external js in a nice way.

Most people instead include external js with a preprocess_page function, or hook_footer. However, in both cases, the external js is added before the scripts added by drupal_add_js (the $scripts page template variable) which can be a performance problem.

I've seen one kind of nasty workaround that (ab)uses drupal_add_js to make a call to document.write:

http://www.wootenswebdesign.com/load-external-js-file-drupal-6


firebus's picture

Quick and dirty views exposed filter form select replacement in a block

I have a client who wants an exposed filter but, instead of having a select drop down, would like to replace it with a set of links.

This is not an uncommon use case, and there are some existing examples on how to do this. It's pretty easy, since views will read a value for the exposed filter from a query string.

But what if your exposed filter form is in a block? Exposed filter forms in blocks only work if you enable AJAX for the exposed filter, and the ajax dynamically replaces the contents of the block with the results of your selection.


Syndicate content

Powered by Drupal - Design by Artinet - Amazon Affiliate