how to use AJAX with Smarty in php?

Good question I will finre and replay u


how to use AJAX with Smarty in php?

very interesting.. and probably quite useful.

There are some libs out there for AJAX that allow you to just define a <div> like:

<div class="ajax" id="pagename.html"></div>

and the div will load the page defined. (I wrote one that does the above and have seen others that have similar syntax)

Maybe that would be a start to work on. I have only looked at smarty but never used it so I'm not sure how to define new template variables but the thing would be to use smarty to generate the html above...

If someone could post up a solution to having smarty write out the following output:

<script type="text/javascript" src="ajax_lib.js"></script>

when the ajax part is loaded. And the something like the following when a user uses one of the variables:

<div class="ajax" id="pagename.html"></div>

I would put together the javascript end...