Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
> I pass table name as the parameter and I get the DBID.
Like this:
var name = "250 Bottles of Beer on the Form";
$.get("main?act=API_GrantedDBs")
.then(function(xml) {
var dbid = $("dbname", xml).filter(function() {
return $(this).text() === name;
}).next("dbid").text();
console.log(dbid);
})
//output
bj4vxvurn
Like this:
var name = "250 Bottles of Beer on the Form";
$.get("main?act=API_GrantedDBs")
.then(function(xml) {
var dbid = $("dbname", xml).filter(function() {
return $(this).text() === name;
}).next("dbid").text();
console.log(dbid);
})
//output
bj4vxvurn