Very simple... just add the javascript to the ajax response. For
example, here's your main file:
<script type="text/javascript" src="jqplot... add them all here "></
script>
<script type="text/javascript">
// button click to generate jquery UI dialog
$('#my-button').click (function (e) {
$('#my-plot').load ('my-jqplot.html').dialog ({
modal: true,
title: 'my jq plot',
width: 400,
height: 400
});
});
</script>
<a href='#' id='my-button'>open plot</a>
<div id='my-plot'></div>
... then create a file "my-jqplot.html" (probably a php, asp or
coldfusion file), which has your jqplot javascript code.