diff --git a/exec/xjs_handler.js b/exec/xjs_handler.js new file mode 100644 index 0000000000000000000000000000000000000000..4def081ef60a288380e26a224cfa788ba287632a --- /dev/null +++ b/exec/xjs_handler.js @@ -0,0 +1,12 @@ +/* Example Dynamic-HTML Content Parser */ + +/* $Id$ */ + +var file = new File(http_request.real_path); +if(!file.open("r")) { + writeln("!ERROR " + file.error + " opening " + http_request.real_path); + exit(); +} +var text = file.readAll(); +file.close(); +write(text.join(" ").replace(/<%([^%]*)%>/g, function (str, arg) { return eval(arg); } ));