MXAJAX - mxData tag basics
The MXAJAX mxData tag is for those using MXAJAX who want complete control over the data (for integration with their own JS controls etc). The tag calls a CFC method or CF function (depending on your setup) and returns JSON corresponding to the CF return type. In a future post I'll discuss each return type, but for now I'm going to demonstrate how to get at the info as the online example doesn't make it clear.
To parse JSON I recommend using the parser (strangely enough) rather that just evaluating it. It's all packaged with MXAJAX, so you can just go ahead in include it in your page. Once it's been parsed, you can do with it what you want; the example below (a slightly modified version of the official mxData 1 example) writes the return into a span:
<html>
<head>
<title>Returning Data from CF page</title>
<script type='text/javascript' src='../core/js/prototype.js'></script>
<script type='text/javascript' src='../core/js/mxAjax.js'></script>
<script type='text/javascript' src='../core/js/mxData.js'></script>
<script type='text/javascript' src='../core/js/json.js'></script>
<script language="javascript">
var url = "<cfoutput>#ajaxUrl#</cfoutput>";
function init() {
new mxAjax.Data({
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:"id=1", cffunction:"getContent"}),
postFunction: handleData
});
function handleData(response) {
var myHTMLOutput = JSON.parse(response);
document.getElementById("myTargetSpan").innerHTML = myHTMLOutput;
}
}
addOnLoadEvent(function() {init();});
</script>
</head>
<body>
<h1>Returning Data from CF page</h1>
<span id="myTargetSpan"></span>
</body>
</html>
The next post will be a more complicated example, doing something with a CF query.

and pass this structure to .cfm page and display its values there how will it be done?
Would you please email me regarding this example at:
wt <AT> wtomlinson.com
Thanks much,
Will
http://www.techscreencast.com/screencast/mxajax_mx...
He shows you how to do that.