Arc Forumnew | comments | leaders | submitlogin
2 points by midnightmonster 6169 days ago | link | parent

In JavaScript (with E4X) on Helma (Rhino-based web framework) with nothing else added:

  var body = req.isPost() ?
    ((session.message = req.postParams.say), <a href={req.path}>click here</a>) :
    (res.message ?
      <p>{"you said: "+res.message}</p> :
      <form method="post"><input name="say"/><input type="submit" /></form>);
  res.write(<html><body>{body}</body></html>);
As a bonus, XSS attacks are impossible.