HTML/jQuery Client Sample:

You will need to reference the EnterMedia JQuery plugin.

  1. 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>

  2. Create a DIV where you want to view the data from the server:

    <div id="showresults">
    </div>

  3. You can use the built in data formatter:
    jQuery(document).ready(function()
    {
        var appid = "media";
        jQuery("#showresults").entermedia({ action: 'listcatalogs',appid: appid });
    });

  4. Or you can define your own formatter by passing along a custom data handler:

        var appid = "media";

        jQuery("#showresults").entermedia({ action: 'search',appid: appid,
        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);        
            });
        }
        });
Last Updated: Fri Mar 19 09:59:38 CDT 2010