See https://twiki.cern.ch/twiki/bin/view/CMS/PhedexProjWebsite for the accompanying documentation. These examples are coded with the assumption that you have the YUI toolkit installed locally, and are running the PhEDEx proxy-server configured to use it. See https://twiki.cern.ch/twiki/bin/view/CMS/PhEDExWebsiteDeveloperGuide for the documentation about that.
Source code for these examples is in CVS in PhEDExWeb/ApplicationServer/examples