My script returns this xml data from my method:
<?xml version='1.0' encoding='utf-8'?><rows><page>1</page><total>1</total><records>1</records><row id='12'><cell>tyutyu</cell></row><row id='11'><cell>yutyyut</cell></row><row id='10'><cell>sdfsdsdf</cell></row><row id='9'><cell>taepsh</cell></row><row id='8'><cell>ffhfghfgfg</cell></row><row id='7'><cell>ytutytytyu</cell></row><row id='6'><cell>yuyttyuty</cell></row><row id='5'><cell>Jaggu Jamfad </cell></row></rows>
However, when I see in response in Firebug I see HTML mixed up with my xml data.
I am using WP MVC which is a MVC framework for WordPress. How can I solve this issue and tell wordpress to only send just xml data. Currently it is sending HTML along with menus and all sort of stuff probably because my action method is in Admin section.
OK. Now here is my html:
<script type="text/javascript">
$(document).ready(function(){
$("#list").jqGrid({
url:'someurl.php',
datatype: 'xml',
mtype: 'POST',
colNames:['ID'],
colModel :[
{name:'ID', index:'ID', width:655},
],
pager: '#pager',
rowNum:10,
rowList:[10,20,30],
sortname: 'ID',
sortorder: 'desc',
viewrecords: true,
caption: 'Beats'
});
});
</script>
<table id="list"><tr><td/></tr></table>
<div id="pager"></div>
Canybody spot the mistake? I have wasted complete 1 hour behind this issue.
Thanks in advance 🙂
I want just confirm you that your problem is only that the ‘someurl.php’ returns the HTML data instead of pure XML data. I don’t use WP MVC myself so can’t help you in the subject.
How you can see from the demo, if your server would return pure XML data, the grid will do display the expected contain.