I'm new to Prototype, and I'm trying to use AJAX to update divs inthe 
background, pulling data from a database.  I've got Ajax.Updater to work 
with the output of a form, but I'm having difficulty with adpting it for 
use with a link.  Basically, I have a list of words produced by the db, 
each of them a clickable link, and when I click on the word I want the 
context of the word (likewise drawn from the db) to come up in a div below 
the list.

What I have at the minute:

*calling page:*
<div><a href="javascript:void(0);" class='textword' id='myword1' 
<div><a href="javascript:void(0);" class='textword' id='myword2' 
<div id="output">[Results appear here.]</div>
function get_word()
    new Ajax.Updater
            method: 'get',
            parameters: { word: $(this).attr("id") }
[db connection stuff]
$sql=query("select * from mytable where word~'$word';");
while ($row=pg_fetch_object($sql))
    echo $context."<br />";

Run by itself, mylist.php gives the results I want, so I think I haven't 
got the right invocation for the link, but after several hours searching 
and experimenting, I have to ask!

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To view this discussion on the web visit 
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to