For SEO purposes and having dynamic content... plain text format generated by your favorite server-side programming language of choice will work. Like:
PHP, ASP, .net, JSP, Perl, Phyton, Cold Fusion, Miva, TCL and more...
Since these languages do all processing on the server before it is sent out to the browser, it is already in plain text. Something search engines can read properly.
Client-side languages will not work since the content is generated by the the web browser. Search engine bots are not web browsers and will simply drop client-side scripting.
JavaScript is client-side.
AJAX is a combination of client-side and server-side, thus generally, AJAX is also not good for SEO, unless it is done properly. Here is a sample of
properly done AJAX for SEO.
Flash is also client-side although can also pull data from a server-side database, it is still client-side and content in Flash is not crawled consistently (Although Google can read the content in .swf files in some cases, it is not perfect and cannot be optimized in the same way you do with plain text.) Although there are still
solutions to do SEO for Flash.