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).
--
View this message in context:
http://www.nabble.com/retrieve-xml-from-a-php-file-tp25784217p25784217.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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