HTML/jQuery Client Sample:
You will need to reference the EnterMedia JQuery plugin.
- Loads the catalog list into the selected DIV:
<script type="text/javascript" src="$home/openedit/javascript/jquery-1.3.2.js"> jQuery.noConflict(); </script>
<script type="text/javascript" src="$home/media/tools/jquery.entermedia.js"> </script> -
Create a DIV where you want to view the data from the server:
<div id="showresults">
</div> -
You can use the built in data formatter:
jQuery(document).ready(function()
{
var appid = "media";
jQuery("#showresults").entermedia({ action: 'listcatalogs',appid: appid });
}); -
Or you can define your own formatter by passing along a custom data handler:
jQuery("#showresults").entermedia({ action: 'search',appid: appid,
var appid = "media";
datahandler: function( inData, inDiv)
{
inData.find("hit").each(function()
{
var id = this.getAttribute("id");
var text = this.firstChild.nodeValue;
inDiv.append('ID=' + id + ' Name:' + text);
});
}
});