10 Years
Discussion Span
Last Post by digital-ether

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...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.