sikd wrote:
> First of all, I'm really sorry about the duplicated mail, but I don't really
> understand the working of this mailing list.
>
> I tried with async ajax calls too, but none of them worked.
>
Ok, so could you switch to asynchronous calls, as this is the
recommended way of using them, and then "alert(xmlDoc)" in your
completed handler, to see what is actually delivered from the server.
You might also want to check your Firebug's net tab, to see request and
response bodies.
T.
>
> thron7-2 wrote:
>
>> I responded to your other mail with the same content. -T.
>>
>> sikd wrote:
>>
>>> I'm a little confused. Trying to find out the solution for this, but just
>>> couldn't for last 2 days.
>>> Any help would be appreciated a lot.
>>>
>>> So, I would like to retrieve throu a qooxdoo's ajax request an xml-file,
>>> which is made dinamically on the server from a mysql database using php.
>>>
>>> Here is my qx code:
>>> var req = new qx.io.remote.Request("getXml.php", "GET",
>>> "application/xml");
>>> req.setAsynchronous(false);
>>> req.addListener("completed", function(e) {
>>> xmlDoc = e.getContent();
>>> var z = xmlDoc.getElementsByTagName('name');
>>> alert(z.length);
>>> }
>>> req.send();
>>>
>>> Here is the getXml.php:
>>> <?php
>>> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
>>> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always
>>> modified
>>> header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
>>> header ("Pragma: no-cache"); // HTTP/1.0
>>> header('Content-type: application/xml');
>>>
>>> @mysql_connect('localhost', 'root', 'root');
>>> mysql_select_db('jcs');
>>> $q = mysql_query('SELECT * FROM users ORDER BY name DESC') or
>>> die(mysql_error());
>>>
>>> $dom = new DOMDocument();
>>> $users = $dom->createElement('users');
>>> $dom->appendChild($users);
>>>
>>> while($r = mysql_fetch_array($q)){
>>>
>>> $name = $dom->createElement('name');
>>> $nameText = $dom->createTextNode($r['name']);
>>> $name->appendChild($nameText);
>>> $users->appendChild($name);
>>> }
>>>
>>> $xmlString = $dom->saveXML();
>>> $dom->save("temp.xml");
>>> echo($xmlString);
>>> ?>
>>>
>>> When I call this php file in the browser (for examle:
>>> http://localhost/getXml.php), it works just fine.
>>> A temp.xml is made, and I get echoed a correct xml structure with correct
>>> values.
>>> But from the qooxdoo Application.js it just doesn't work. (z.length = 0).
>>>
>>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel