My Projects: 52weeksofUX | Microcopy | ABtests.com | One Flight Books | Performable

AJAX Pages: Embedded Javascript

by Joshua Porter  |   2 Comments  |  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.

Check out my latest project: Make them Care!, a book on designing great sign-up experiences. Get reminded when it's published.

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.