You sure could, but you'd need to be able to get at the widgets somehow. I've found much higher performance (faster response, faster downloads) from EdgeCast vs. Akamai, also.
Say, for instance, you've got the code for a form at http://cdn.mysite.com/form1.html and a user clicks on a link that would bring up that form.
Use something like this as a script:
$(document).ready( function() {
$(".widget .trigger").click( function() {
url = $(this).attr("rel");
$(this).parents(".widget").load(url, function () {
// Do what needs to be done to the widget code here
// Example: make it an AJAX form.
});
});
});
And then have this Markup:
<div class="widget">
<a href="javascript:void(0);" rel="http://cdn.mysite.com/form1.html">Widget Trigger</a>
</div>
And have this on your CDN:
<form action="/ajax/hander/" method="POST">
<fieldset>
<legend>This is a pretty cool form</legend>
<label for="form1input1">Make this cool:</label>
<input id="form3input1" name="something" type="text" />
<input type="submit" value="Coolify" />
</fieldset>
</form>
You could then have some code server side that uploads snippets to your CDN, saves their URL in a database, and generates the links with the appropriate rel tag by pulling that value from something fast like Memcached. That part will vary greatly based on your language of choice.