Ron Savage wrote:
On Wed, 08 Nov 2006 20:43:36 +0000, RA Jones wrote:

Hi

Well, I could throw in a couple of (slightly off-topic) AJAX
questions if anyone cares to field them, or have we had enough of
that topic recently?

Throw them in (aka I'm bored...)!

That's what I wanted to hear! In one of the previous discussions about getting AJAX working it was suggested that a major advantage of using the js libraries such as JQuery and prototype over CGI::AJAX was so the browser could cache the code blocks and not have to re-load on each page refresh. However, I found a limitation here in that I have to hard-code the url containing the AJAX function, whereas with CGI::AJAX I can pass it as a parameter from the script using the CGI.pm url() function, meaning I can run my apps as cgi or mod_perl without needing to change anything. This is actually quite a long-winded way of asking if there is a javascript equivalent to the CGI.pm url() I could put in the js block?

Secondly, having managed to make the basic div replace functions work nicely with AJAX, I'm trying something a little more adventurous - how to populate a drop-down menu depending on the selection of another drop-down menu. I can make it work with the following, but it feels wrong:

First drop-down:
<select onBlur="populate_clinicians(['src_id'], ['clin_list']); return true;" name="src_id" id="src_id">
  <option value="">&nbsp;</option>
  ..
</select>

Dependant drop-down generated by:
<div id="clin_list"></div>

And all the code for generating the select block (ie popup_menu()) is done in the populate_clinicians() sub in the main application, instead of in the template. Yak! But it works. Please tell me there's a better way.
--
Richard Jones
Leeds, UK
mailto:[EMAIL PROTECTED]

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to