AJAX Pages: Embedded Javascript

by Joshua Porter  |   September 15th, 2005  |  shortlink: http://bokardo.com/p/214

This has the potential to be very popular: a project called Ajax pages has just been released, with the intent to allow people to embed Javascript code in HTML like we do with PHP, ASP, and JSP.

It’s not server-side, though, from what I can tell. It’s simply a way to manipulate things client-side in a familiar way.

Here’s an example:

<html>
<body>
<% var hello = "Hello World"; %>
<%=hello%>
</body>
</html>

Check out the tutorial to see how it works.

Make them Care! - Struggling to communicate the value of your product or service? I'm writing a new book that shows you how to make people care about your product or service by clearly communicating the most important bits. For designers and marketers creating product web sites. Find out more.

Links to this Post

Comments

1.  Jeff Watkins 8:49am, Thu 15th, 2005

Yeah, I’d run across this before, but I’m still not certain what the point is. Now if this were a server environment on par with JSP — but without the memory requirements — I’d jump on it in a heartbeat. After all, I *love* Javascript.

Maybe I’m just crazy, but I don’t find the DOM that difficult to manipulate. Especially if you use shortcuts like the $() notation.

2.  Justin Meyer 6:09pm, Sun 30th, 2007

You should check out EJS. It’s pretty much the same thing, but it includes rails-like html helpers, some built in AJAX functionality, and debugging support. It’s got a nice walkthrough and screencast showing how to use it.