Forum Discussion
JackFretwell
7 years agoQrew Assistant Captain
***** it works! *****
Thank you for all the pointers!
(function(){
$("img[qbu=module]").remove();
$("a.QBU_Button").css({"margin-top": 0});
$("a.QBU_Button").parent("td").css({"border-top": 0});
let dbid = "bnwnjkext";
let dbidRecords = "bn2h9ha3c";
let dbidReference = "bn2igarv2";
$("a.QBU_Button").on("click", function(event) {
let rid = this.dataset.rid;
let refcode = this.dataset.code;
$.get(dbidReference , {
act: "API_DoQuery",
query: '{6.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_59.value = $("peritem", xml).text();
})
});
});
})();
Thank you for all the pointers!
(function(){
$("img[qbu=module]").remove();
$("a.QBU_Button").css({"margin-top": 0});
$("a.QBU_Button").parent("td").css({"border-top": 0});
let dbid = "bnwnjkext";
let dbidRecords = "bn2h9ha3c";
let dbidReference = "bn2igarv2";
$("a.QBU_Button").on("click", function(event) {
let rid = this.dataset.rid;
let refcode = this.dataset.code;
$.get(dbidReference , {
act: "API_DoQuery",
query: '{6.EX.${refcode}}',
clist: "9"
}).then(function(xml){
$("record", xml).each(function() {
_fid_59.value = $("peritem", xml).text();
})
});
});
})();
_anomDiebolt_
7 years agoQrew Elite
I would think it does not work as you think it does:
The body of the each loop is performing the exact same assignment for every. record. You might be getting confused because this statement alone concatenates all the <peritem> values into on string and assigns it to fid=59
(function() {
$("img[qbu=module]").remove();
$("a.QBU_Button").css({
"margin-top": 0
});
$("a.QBU_Button").parent("td").css({
"border-top": 0
});
let dbid = "bnwnjkext";
let dbidRecords = "bn2h9ha3c";
let dbidReference = "bn2igarv2";
$("a.QBU_Button").on("click", function(event) {
let rid = this.dataset.rid;
let refcode = this.dataset.code;
$.get(dbidReference, {
act: "API_DoQuery",
query: '{6.EX.${refcode}}',
clist: "9"
}).then(function(xml) {
$("record", xml).each(function() {
_fid_59.value = $("peritem", xml).text();
})
});
});
})();
The body of the each loop is performing the exact same assignment for every. record. You might be getting confused because this statement alone concatenates all the <peritem> values into on string and assigns it to fid=59
_fid_59.value = $("peritem", xml).text();