Home Blog CV Projects Patterns Notes Book Colophon Search

YUI for AJAX Replace

14 Aug, 2007

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);

Copyright James Gardner 1996-2020 All Rights Reserved. Admin.