This shows how to get the contents of a script via ajax, also shows off how to take that contents and render it in a dynamically created modal dialog.
Use cases for this are, where you want to launch dialogs/applications programmatically, and don't want to use frames, since you want to support mobile, or you want to use WCM Menu Component to pick which scripts should be displayed based on some taxonomy or pzn rule.
NOTE: You must update the url in the javascript to the url to a script content item in your wcm library for what to launch. Several ways of getting this, one you can grab the url from the src from the iframe for the preview window of a script, other is to use the public WCM url tag, finally you can use the public wcm servlet rendering url format.
Click to open a dialog whose content is loaded via ajax from a Script Portlet that was created elsewhere, without using an iFrame and without pointing to a portlet instance. No portlet instance is needed to hold the script.