JS魔鬼中的天使MOD

JavaScript Projects:
(JavaScript Template Toolkit)
A more fully featured Template system than Trimpath
Note:This project was never actively developed, and was only a toy. If you want something like this but actively developed, I suggest looking at
or one of the projects from .
What? Are you mad?
Yes, we quite probably are. But not as mad as .
mod_js is a standalone module for Apache (1.3 currently, v2 module will be coming soonv2 now) that allows you to execute JavaScript (technically it’s ECMAScript) on the server.
In its current form it is just a very simple proof of concept. Consider the following example:
// Populates params variable from request.env.QUERY_STRING
include('/Users/tomi/Sites/scripts/util.js');
print("&html&&head&");
print("&title&Page title here&/title&");
print("&/head&");
print("&body&");
print("&pre&");
tree( params, "params");
print("&/pre&");
// You can print E4X objects
print(&form method="get"&
&input name="value" /&
&input type="submit" /&
print("&pre&\n");
tree( this, "this" );
print("&/body&&/html&");
If you have ever used perl’s CGI.pm, this might look familiar to you. As it should - it’s loosely what we based the interface on.
If you really want to look at how we did it, you can look at the . To try it out yourself:
svn co http://www.modjs.org/svn/trunk/mod_js
./configure
sudo make install
(Until the code is in a situation to actually be useful, there wont be a dist available, and as such you will need autoconf.)
The code for mod_js is dual licenced under GPLv3 and Apache License 2.0.
wrote mod_js as a simple proof of concept during one of Fotango (which has since shutdown. Shame) hack days. Our thanks go out to Fotango for being enlightened enough to let us have hack days, and to release this. Thanks.当前位置:&&&插件
找好玩手机游戏,上&

我要回帖

更多关于 舌尖上的中国 的文章

 

随机推荐