Project Description JavaScriptClientPages is a cross-browser, cross-platform tool, which makes dynamic client-side content generation as easy as it is on the server side with technologies like ASP.net, PHP, Ruby on Rails, etc.. Each JavaScritpt Client Page is a complete XHTML page with embedded JavaScript code, as well as custom output tags that make it possible to create clean XHTML templates with advanced presentation logic while eliminating the drudgery of writing custom DOM manipulation code or innerHTML construction.
Pages are compiled to compressed DOM-generating code that can then be used to insert the generated content to an arbitrary element on an existing page.
Important: The latest update fixes the table generation issue that existed in the original check-in with Internet Explorer 7 and below. The fix has not been tested on IE6 yet.
Note for Developers: Building the project now requires the
MSBuild Community Tasks available at
http://msbuildtasks.tigris.org/. This is necessary to automatially create ZIP archives for per-platform releases. This is only applicable to those who want to build JavaScript Client Pages from the source tree. End users should download the latest release instead.
The DiXon CompilerDiXon Generation 1 is a highly portable JSCP-to-JavaScript compiler implemented as an XSLT 1.0 stylesheet without any dependencies on non-standard extensions (msxml, exslt, etc...), which makes it possible to use it in any environment that has an XSLT 1.0 processor in its XML processing libraries. Each platform binding is a small piece of code that invokes the XSLT processor on all requested pages that need to be recompiled.
As of now bindings/bootstrappers have been implemented for
- .NET (tested on Microsoft's implementation only)
- PHP
- .NET/Mono - an cross-platform, open-source implementation of the CLR and a significant subset of .NET APIs
- Java
- Python
- Ruby
JSCP Code Sample
<table>
<thead>
<tr>
<th>Code</th>
<th>Name</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<!--
Embedded code with processing instructions
Similar to: JSP without taglibs, ASP.old and PHP
-->
<?js for(var i=0;i<items.length;i++) { ?>
<tr>
<td class="code"><?js text('Item #' + items[i].code); ?></td>
<td><?js text(items[i].name); ?></td>
<td><?js MyLib.formatCurrency(text(items[i].price)); ?></td>
</tr>
<?js } ?>
<!--
XML-based presentation logic tags
Similar to: ASP.net, JSP with taglibs, JSF
-->
<js:forEach collection="items" item="item">
<tr>
<td class="code">Item #<js:Text value="item.code" /></td>
<td><js:output value="items.name" /></td>
<td><js:output value="MyLib.formatCurrency(text(item.price));" /></td>
</tr>
</js:forEach>
</tbody>
</table>
Project StatusThe project is on its way to an initial release. As of now, while it should be fairly usable, it is still in development, and developer documentation is still in the process of being written. See the
Road Map for more details.
LinksXML Schemas