Help with jQuery / Ajax / Highslide please

Help with jQuery / Ajax / Highslide please

I am trying to implement pop-up images on a site, but the descriptions reside in a database.
 
I figured that I could use Highslide to do the image pop-ups.
 
It was recommended to me to use jQuery to pull the descriptions from the database for the captions.
 
What I'm trying to figure out is how I would go about that with jQuery. My understanding is that I need to run a function in response to the onClick event for the images/hyperlinks (some pages don't have images but have only links), in that function I need to grab the description and set it to the hs.captionText variable, then execute the hs.expand function for the given image/hyperlink.
 
I have tried it without jQuery, using standard AJAX. I called a function that I built in response to the onClick event, made my AJAX call and when the readystate was 4, I set the hs.captionText to the response text from my called PHP file. Immediately after that, I called the hs.expand command, on the passed ID for the image/hyperlink. However, this does not work for me and only displays the image itself in basically a new page.
 
I also tried combining the assignation of the captionText to the response text into the hs.expand call, however I received the same results.
 
So, that's what I need to do. I am totally new to jQuery. I've never used it before at all.
 
Any help is appreciated.