WARNING: This page is archived and not updated. Please bear in mind any information may be incorrect and any code may not work. Use at your own risk.
James Gardner: Home > Blog > 2007 > YUI for AJAX Replace

YUI for AJAX Replace

Posted:2007-08-14 10:30
Tags:Web, JavaScript

Here's the same example as before but implemented using YUI rather than scriptaculous:

    onchange="callAJAX('%s','diseases-select'); return false;"%(
<script type="text/javascript">
function callAJAX(sUrl, replace){
    var callback = {
    success: function(o) {
        YAHOO.util.Dom.get(replace).innerHTML = o.responseText;
    failure: function(o) {
        alert("Failed to retrieve required information.");
sUrl = sUrl +'?TopicSet-1.TopicID='
sUrl = sURL+YAHOO.util.Dom.get('TopicSet-1.TopicID').value;
var transaction = YAHOO.util.Connect.asyncRequest('GET', sUrl,
       callback, null);

(view source)

James Gardner: Home > Blog > 2007 > YUI for AJAX Replace