Re: XMLHTTPRequest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ted,

Your send() call is asynchronous, meaning you don't receive results immediately. Register onload event listener and wait; you can easily find proper usage patterns in the net.

Also, it is not productive to ask questions without looking at server logs, _javascript_ console and LiveHttpHeaders first. Many things could go wrong with your setup and we would not even know it.
--

With Best Regards,
Marat Khalili

On July 15, 2015 7:12:21 PM GMT+03:00, Ted Hickox <megelinic@xxxxxxxxx> wrote:
I'm trying to master AJAX.  This is my _javascript_ code:

var Data_Display
var My_Data

function Setup() {

     My_Data = new XMLHttpRequest();
     My_Data.open("GET","http://localhost:8080/exist/rest/db/apps/HTML_Student/SVG_Data.xq");
My_Data.send();
document.getElementById("Information").value = My_Data.responseXML;

}

This is my XML

<xml>
<svg>
<svg_data>100</svg_data>
</svg>
</xml>

This is my XQuery

xquery version "3.0";
for $Data in doc("Database_Example.xml")/xml/svg/svg_data
where $Data = "">
return $Data

When I open my webpage, nothing appears in the textbox.  Am I doing something wrong?

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux