I am trying to dynamically load a new sentence for a word a of a language learning flashcard.
I was thinking of calling a local or a remote LLM for this task. I wasn’t able to find how to call a system command, so I went for the second option.
Below my attempt at a front template to fetch a url. It updates the div block with an empty string, are http requests blocked?
<div id="front">Loading…</div>
<div id="debug">start</div>
<script>
const http = new XMLHttpRequest();
const url='http://ifconfig.co/ip';
http.open("GET", url);
http.send();
http.onreadystatechange = (e) => {
document.getElementById('front').innerHTML = http.responseText;
document.getElementById('debug').innerHTML = 'loaded';
}
</script>
I understand the ability to use javascript is not well supported.