I've got an ajax handler that validates a result and does this:
centerpanel = $('#mainlayout').layout('panel', 'center');
centerpanel.panel({ content: contentdata } );
contentdata sometimes has javascript in it, using $(function(){...}); to do some modifications to forms and such. the first one like this loads and works correctly, the 2nd one causes the "$(function()" line to generate "Uncaught ReferenceError: $ is not defined" errors. javascript functions in the same script block will still work though, it just doesn't like the initial jquery stuff.
I've even tried modifying the code, the first $( always works, the 2nd+ always error, no matter what the code is.
I've done this before using jquery's .html() and the code always runs fun, but doing .html(contentdata); to a panel seems to turn the panel into a plain div.
is there a better way to handle the javascript blocks, or something I need to do to bless them?