How to use YAHOO.util.Connect.asyncRequest and return results?
问题 I'm using YAHOO.util.Connect.asyncRequest to get data from database, here is the code : function getCountArticle(contentCurValue) { var handleSuccess = function (res) { var countPubmed = YAHOO.lang.JSON.parse(res.responseText); var contentCountPubmed = countPubmed.totalArticleRecords; alert(contentCountPubmed); //return 15 for example }; var handleFailure = function () { alert("Error connecting data : Bad pubmed query"); }; var callback = { success:handleSuccess, failure:handleFailure,