From: Florian S. <ml-...@fl...> - 2024-08-19 18:22:42
|
Ted, as far as I see, you never send() your request. The open() method specifies / initializes the request, but it doesn't send/execute it. See: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open https://www.w3schools.com/xml/ajax_xmlhttprequest_create.asp HTH Florian Am 19.08.24 um 19:52 schrieb Ted Hickox: > I keep hitting a stone wall. If I write my code like this: > > function Setup() { > var XMLHttp; > var JSON_Data; > > XMLHttp = new XMLHttpRequest(); > XMLHttp.open("GET", > "http://localhost:8080/exist/rest/db/apps/HTML_Student/people.json > <http://localhost:8080/exist/rest/db/apps/HTML_Student/people.json>", > true); > > > document.getElementById("JSON_Text").value = "I'm right > here."; > > } > The words I'm right here appear in the textbox. > > But if I write my code like this: > > function Setup() { > var XMLHttp; > var JSON_Data; > > XMLHttp = new XMLHttpRequest(); > XMLHttp.open("GET", > "http://localhost:8080/exist/rest/db/apps/HTML_Student/people.json > <http://localhost:8080/exist/rest/db/apps/HTML_Student/people.json>", > true); > XMLHttp.onReadyStateChange = function(){ > > document.getElementById("JSON_Text").value = "I'm right > here."; > }; > } > > Nothing appears in my textbox. And I don't understand why. Can > someone please explain this to me? |