哪吒机器人提醒:

提醒:juliklive
【标题】Sequencing AJAX requests on "ask-first basis"
【摘要】so imagine you have this autocomplete thingo. or a dynamic search field. anything that updates something via ajax when it's value changes.now, it's tempting to do this (i am speaking prototype.js here, jquery would be approximately the same. function updateresults(field) { new ajax.request('/s', { method:'get', parameters: {"term": field.value}, onsuccess: function(transport){ var archivelist = transport.responsetext.evaljson(); displayresults(archivelist); // this updated the dom } })... (07-16 05:49)