Re: Javascript + jquery + php page

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
FreeMarker just generates text (like HTML, JavaScript, whatever) on
the *server* side. So of course you can have AJAX, jQuery etc. on your
FreeMarker-generated web pages. But mind you, JavaScript runs on the
*client*, and hence after FreeMarker was generated the page.

You can't (or shouldn't) use FreeMarker on the same way as you use
PHP. With PHP you do all the program logic including the presentation,
while with FreeMarker you do the presentation only. FreeMarker is for
MVC frameworks, where it's used for the MVC View. Do the non-View
programming in Java, Groovy, Scala, or whatever you prefer, but not in
FreeMarker. (Or if you don't need MVC, you don't want to use
FreeMarker.)

Saturday, August 27, 2011, 8:57:10 PM, Håvard Wahl Kongsgård wrote:

> Hi, without  success, I experimented with including simple Javascript
> Ajax code interacting with a PHP site in freemaker templates.
>
> example
> http://yensdesign.com/2009/01/create-a-shoutbox-using-php-and-ajax-jquery/
>
> With the current version of freemaker is it possible to include this
> type of code in freemarker templates?
>

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.