Re: Can you parse JSON with the eXist database?
Florian Schmitt <[email protected]> Mon, 19 Aug 2024 20:22:51 +0200
| Newsgroups | gmane.text.xml.exist |
|---|---|
| Message-ID | <[email protected]> |
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?
_______________________________________________
Exist-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/exist-open