Here is client Side code:
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
url:'example.php',
datatype: 'xml',
mtype: 'GET',
colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
colModel :[
{name:'invid', index:'invid', width:55},
{name:'invdate', index:'invdate', width:90},
{name:'amount', index:'amount', width:80, align:'right'},
{name:'tax', index:'tax', width:80, align:'right'},
{name:'total', index:'total', width:80, align:'right'},
{name:'note', index:'note', width:150, sortable:false} ],
});
});
Here is example.php code:
<?php
header("Content-type: text/xml;charset=utf-8");
print "<?xml version='1.0' encoding='utf-8'?>";
print "<rows>";
print "<page>1</page>";
print "<total>1</total>";
print "<records>1</records>";
print "<row>";
print "<cell>0</cell>";
print "<cell>08-01-03</cell>";
print "<cell>2</cell>";
print "<cell>4</cell>";
print "<cell>12</cell>";
print "<cell><![CDATA[Aiutooooooooo]]></cell>";
print "</row>";
print "</rows>";
?>
Till now everything is just fine, but if now I try to get xml data from my perl cgi script it won't work, and data is not displayed.
Here is the perl code:
#!/usr/bin/perl
use CGI;
print CGI->header("Content-type: text/xml;charset=utf-8");
print "<?xml version='1.0' encoding='utf-8'?>";
print "<rows>";
print "<page>1</page>";
print "<total>1</total>";
print "<records>1</records>";
print "<row>";
print "<cell>0</cell>";
print "<cell>08-01-03</cell>";
print "<cell>2</cell>";
print "<cell>4</cell>";
print "<cell>12</cell>";
print "<cell><![CDATA[Aiutooooooooo]]></cell>";
print "</row>";
print "</rows>";
and in the jqGrid code I put on url = 'cgi-bin/example.pl',
As you can notice the perl and php codes are similar but don't do the same thing why ?
If you got any hints on how to debug this, please forward. Thanks,