Below you can find an example of some JQuery code that you can use to do the same as described in a previous article. I’ve stopped using the previous code, as it had too many downsides. After getting to know the power of JQuery, I have to say that it’s much better. AND it’s already included in the drupal distribution.
Example
$(document).ready( function(){ $("select").change(function () { var about = this.value; var uri = '/my/page/' + about; $.get(uri, function(data) { $("#div-with-updated-data").html(data); }); }) } );
NOTE: Don’t try to use mooscript, scriptalicious, … or any other framework that doesn’t extent JQuery within your drupal. It will give you a lot of “function unkown” situations. 😉
OK. I bite. I don’t get it, where do I put this? In a script tag? How do I access it? What’s the format of the data?
The above is pure javascript code which connects to a html page located at http://www.example.com/my/page/*variable* and puts the results in #div-with-updated-data