Difference between revisions of "User:Fbstj/gadget/history-test.js"

m
try this
m (oops)
m (try this)
})
 
// determine if this page is a Cite: Arcanum page
function check_for_arcanum() {
 
const entry = page_name.split('-')[1];
return 'https://wob.coppermind.net/api/entry/'+ entry +'/';
}
function build_from_json(json) {
console.log(json)
}
/* auto-fill [[Cite: Arcanum-@entry]] pages*/
$(function () { console.log(check_for_arcanum()) })
const url = check_for_arcanum()
fetch(url).then(function(resp) { return resp.json() }).then(build_from_json)
})