Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
Or this version which employs Async / Await:
(function(){
async function getDBID(name) {
var xml = await Promise.resolve(
$.get("main?act=API_GrantedDBs")
);
var dbid = $("dbname", xml).filter(function() {
return $(this).text() === name;
}).next("dbid").text();
return dbid;
}
var name = "250 Bottles of Beer on the Form";
getDBID(name).then(function(dbid) {
console.log(dbid, name)
});
})();
//output:
//bj4vxvurn 250 Bottles of Beer on the Form
RohitAgarwal
8 years agoQrew Cadet
Where I will find this gReqAppDBID Global Variable.