var goldenEggsUrl = "/yubnub_suggest_files/all_golden_eggs.xml"; var cmdValues = [];
function preloadCommandXML() { document.input_box.command.value = 'Please Wait... Loading'; var ajx = new Ajax.Request(goldenEggsUrl,{method:'get', onException:exception, onComplete:parseCommandXML}); }
function parseCommandXML(request) {
var cmds = request.responseXML.getElementsByTagName("item");
for(var i=0; i < cmds.length; i++) {
cmdValues.push(cmds[i].getElementsByTagName("title")[0].firstChild.nodeValue);
}
document.input_box.command.value = '';
document.input_box.command.focus();
}
function exception(ex) {
alert("Whoops! Ajax.Request threw an exception");
}
One reply on “YubNub Suggest – script.aculo.us”
[…] First YubNub Suggest example used script.aculo.us. This time tried Dojo’s autocomplete code. Smoother auto complete, including support for arrow keys, but has a harder time selecting an option. Doesn’t seem to like space as a keystroke selector. You can try it out for yourself. […]