nextwebgen.com

The Next Generation Web Now

Declarative Ajax

Filed under: Web 2.0 News, Front Page, JavaScript, Articles, Ajax — Dion Almaer at 8:26 am on Tuesday, July 18, 2006

Duncan Cragg thinks that The Right Way to do Ajax is Declaratively:

Don’t write your interactive Web application in custom Javascript! The Web’s Declarative nature needn’t be broken just because you want two-way dynamic data instead of one-way documents on your site.

Instead, write Declaratively to generic Javascripts, plugins and browser features such as Hijax, hInclude, XForms, SVG, XBL, etc.

Duncan goes into details of declarative talks from XTech this year and his thoughts on where we should be going.

Json.NET 1.1: Converting between XML and JSON

Filed under: Web 2.0 News, Front Page, JavaScript, Library — Dion Almaer at 8:21 am on Tuesday, July 18, 2006

James Newton-King has updated his Json.NET library to version 1.1.

The major new feature is that you can now almost seamlessly convert between XML and JSON:

XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<?xml version=""1.0"" standalone=""no""?>
<root>
  <person id="
"1"">
    <name>Alan</name>
    <url>http://www.google.com</url>
  </person>
  <person id="
"2"">
    <name>Louis</name>
    <url>http://www.yahoo.com</url>
  </person>
</root>"
);
 
string jsonText = JavaScriptConvert.SerializeXmlNode(doc);
//{
//  "?xml": {
//    "@version": "1.0",
//    "@standalone": "no"
//  },
//  "root": {
//    "person": [
//      {
//        "@id": "1",
//        "name": "Alan",
//        "url": "http://www.google.com"
//      },
//      {
//        "@id": "2",
//        "name": "Louis",
//        "url": "http://www.yahoo.com"
//      }
//    ]
//  }
//}
 
XmlDocument newDoc = (XmlDocument)JavaScriptConvert.DeerializeXmlNode(jsonText);
 
Assert.AreEqual(doc.InnerXml, newDoc.InnerXml);
 

The Importance of Maintainable JavaScript

Filed under: Web 2.0 News, Front Page, JavaScript, Programming — Chris Cornutt at 7:48 pm on Monday, July 17, 2006

There are three levels of Javascript programming that developers should go through:

  • beginning programming with popups and roll-overs everywhere
  • advanced Javascript coding with site-enhancing functionality and loads of bells and whistles
  • writing maintainable Javascript

That last one throw you for a loop a bit? Well, read on…

It’s one thing to develop code that runs well and that does the job, but without structure and formating as a practice in your development, things can get pretty scary pretty quick. Even this new article from Vitamin reinforces the fact.

Forums and mailing lists are full of requests about Ajax, DOM Scripting and how to use this or that library or effect. There is also an extraordinary amount of scripts, libraries and effects being developed and showcased, and the blogs and news sites specialising in scripting hardly have time to look at the demos properly before they are on Digg.com or del.icio.us and making the rounds from these sites.

Times to celebrate for those who have hung on to their skills when the DHTML craze subsided in 2001 and JavaScript became persona non grata on your CV as a main skill.

They talk about not only some of the benefits of having well-maintained scripts (making the user’s life easier), but some techniques to help you keep things neat in your own work. They make suggestions like “Keep your syntax and structure clean and logical”, “Seperate textual content and code” and “Comment your code” (funny how that last one pops up so often, eh?)

All in all, they give you eight different tips on how to “keep it clean” when it comes to creating code, all with descriptions/explainations and code examples where appropriate.

Adobe Spry and PHP/MySQL

Filed under: Web 2.0 News, Front Page, JavaScript, Library, Articles — Dion Almaer at 8:20 am on Wednesday, July 12, 2006

Mike Kornienko took Adobe's Spry Framework for a spin.

He has written up his thoughts on integrating it with a PHP/MySQL backend:

Spry is Adobe's Ajax library for manipulating XML data. It has some very unique and pretty useful functions like regions handling, related auto-updating data and stuff like that. For example, you can load XML file into your HTML document, created a template-like markup for with some spry: tags in it, and Spry will do the rest - will read the XML file and output it into your web-page in the format you have defined. Not only that. You can have several connected data sets so that when you select a row in the main table generated by Spry, and if you have a region on your web-page which is somehow depends on selected row in main table, this region will be updated automatically.

The article shows the XML that you give to Spry, the libraries involved, and the HTML components:

<input type="button" value="sort id" onclick="dsTest.sort('id','toggle')""/>
<input type="button" value="sort title" onclick="dsTest.sort('title','toggle')""/>

<input type="button" value="sort content" onclick="dsTest.sort('content','toggle')""/>

<div spry:region="dsTest">
<table border="1">
<tr spry:repeat="dsTest">
<td>{@id}</td>
<td>{name}</td>
<td>{place}</td>
</tr>
</table>
</div>
 

A Basic Approach to Server-side Data Validation with AJAX

Filed under: Web 2.0 News, Front Page, JavaScript, Programming — Chris Cornutt at 8:03 am on Wednesday, July 12, 2006

Input validation can be one of the biggest hurdles in a web application (besides being one of the most important). As much as we as developers hate to think about it, there will be users out there that try to stretch the limits of the app, finding the weak spots. Don't let input validation be yours - always check what the user gives you. How, you ask? Well, that's what this new article from DevArticles.com is for.

Would you like to learn how to validate user-supplied data using JavaScript, but without the risks? This article will show you how to handle it in a way that takes advantage of JavaScript's pluses, but adds a level of safety, thanks to AJAX. It is the first of three parts.

This validation mechanism can be developed bearing in mind specific conditions where JavaScript has been disabled by the client, while still maintaining its full validation capabilities on the server. Indeed, this approach can be quite useful for constructing richer Web applications, and that's precisely what I'm going to do in the next few lines: build an AJAX-driven form validation application, which will use PHP for validating data on the server.

They start building their sample application with the interface - a simple form. Since a basic form is a bit of an eyesore, they also use a little bit of CSS to help clean it up a bit. They combine them both to make the sample interface (complete with code/HTML). There's no Javascript or validation in this part of the series, but this does lay down the groundwork for the future editions as they get more and more advanced.

Tuesday Morning Roundup

Filed under: Web 2.0 News, Front Page, JavaScript, Safari, Prototype, Ruby, Scriptaculous, RichTextWidget, Tip — Rob Sanheim at 9:00 am on Tuesday, July 11, 2006

Tuesday morning roundup!

  • Lesserwiki - a very light Ruby on Rails wiki very similiar to TiddlyWiki, with all updates done continuously on one page, double click to edit, etc.
  • Article on Writing Custom Iterators for Prototype from Encytemedia
  • A Prototype solution to the DOM Ready issue (see Dean's post for background info)
  • Javascript object < -> Rails object marshalling capability has been integrated into Protowidget - demo here, detailed explanation here - looks cool and could also function on its own.
  • An Ajax-ready slide transition library (demo) based on the popular Prototype/scriptaculous combo.
  • Reducing the perceived responsiveness of your app with the "W AJAX" design pattern - using background threads on the server to load complex data while the browser continues to load the easy stuff.
  • Safari hates trailing commas like this:
    new Effect.Highlight('foo', {duration:0.5,startcolor:'#ff99ff',});
    while FF and IE don't care. Bruce Williams has a quick and dirty Ruby test case to find offending scripts so you can catch it early in your build.

Sifl n Olly's Chester on his love skills. (mp3, probably NSFW)

updated: made title less stupid

JBoss Seam knits AJAX and Java together

Filed under: Web 2.0 News, JavaScript, Ajax, JBoss — Admin at 8:45 am on Friday, July 7, 2006

JBoss has joined in the AJAX game with the launch of an open-source framework for AJAX applications called Seam.

The framework, written in Java and released under the LGPL, is aimed at making developing interactive web applications easier by providing a standard set of UI widgets and back-end classes. The toolkit also contains components to make programming in a Web environment easier by taking care of session management and application workflow.

Several AJAX frameworks have been released recently, notably the Google Web Toolkit. However, as yet there’s little effort to produce a vendor-neutral standard for such frameworks in any language. Without a framework like Seam or GWT, you have to write your own client-side code and server-side components to support them. However, GWT isn’t entirely open source, containing one binary-only component.

[Read More]

Echo2 Widget Panel

Filed under: Web 2.0 News, Front Page, JavaScript, Library — Admin at 1:43 am on Friday, July 7, 2006
Dietrich Kappe reported on an announcement made on the Echo2 developer list, talking about a new component panel similar to what you see on Google IG. Dietrich kindly put up a demo page. Echo2 Widget Panel
« Previous PageNext Page »