Forum Discussion
JoshuaTate
7 years agoQrew Cadet
javascript is not a quickbase thing, its a web standard. check out Mozilla Developer Network and W3Schools to learn about web languages. now i will give you a fast class on fetch:
fetch requires at least a url in position 1 and option init (initialise instructions)
example:
var url = "https://yourquickbasedomain.quickbase.com/db/tableid?a=APIAddrecordetcetcetc";
var init = {
method: "POST",
credentials: "include",
headers: {
"Content-Type": "application/xml"
},
body: //put you body here
};
fetch(url, init).then(response => response.text()).then(str => (new DOMParser()).parseFromString(str, "text/xml")).then(function(xml) {
let rid = $("rid", xml).text()
console.log(rid);
})
fetch requires at least a url in position 1 and option init (initialise instructions)
example:
var url = "https://yourquickbasedomain.quickbase.com/db/tableid?a=APIAddrecordetcetcetc";
var init = {
method: "POST",
credentials: "include",
headers: {
"Content-Type": "application/xml"
},
body: //put you body here
};
fetch(url, init).then(response => response.text()).then(str => (new DOMParser()).parseFromString(str, "text/xml")).then(function(xml) {
let rid = $("rid", xml).text()
console.log(rid);
})
JoshuaTate
7 years agoQrew Cadet
another piece of advice, learn about ECMA 2015, 2016, 2017 and 2018. There is no need to learn about framework languages like Angular, Vue, React etc all the cool stuff these offer are 95% available in native javascript in all modern browsers. if theirs something you cant do i am certain you can get a library for it to extend the functions available to you. Dont be afraid to insert your own scripts via service workers or other hacky means (aka Image On Load, Brand On Load as populerised on quick-base by Dan). Doing anything but native javascript may shoot you in the foot 6 months down the track, web standards ensure backward compatibility i.e so you can still look at your cat memes from 1993 today like you can in 2100 ;)_