Friday, November 4th, 2005

Just Attributes: Adding new attributes to your HTML markup

Category: Toolkit

<p>Giorgio Braga has created a new product: Just Attributes.

Just Attributes hides all javascript code behind simple attributes on the standard HTML tags.

All basic functionality (one-page-site building, two-ways connections with databases, etc) are already there. More client features are under construction.

You load up some JavaScript via:

<script src=”http://www.justattributes.com/ja.asp”></script>

And then you have access to attributes on your HTML elements such as:

Ajax Form

<form ajax action=surl target=sid></form>

This declares that the form requires a AJAX behavior, complying with the “one-page-site” concept, and consequently loading sURL results into an existing page element (sID).

Autofeeding Select

<select (src=sURL (default=sOption)) (bindTo=sID bindAs=sKey) (preserve)>

Many more

All of the enhancements are on the references page on the justattributes site (unfortunately since it is a single page, there isn’t a direct link!)

Enhanced tags are: button, div, form, img, input, li, select, span, td

And there are many enhanced/new attributes.

One small thing. xhtml style would be good (e.g. ajax=”true” versus ajax).

just-attributes

Related Content:

Posted by Dion Almaer at 3:23 pm
10 Comments

+++--
3 rating from 5 votes

10 Comments »

Comments feed

Would <form ajax=”ajax” work?

What do other developers feel about non-standard attributes in the tag? This would stop the page from validating, no?

Comment by Mike Ritchie — November 4, 2005

Of course xhtml style is not forbidden!

ajax=”true” and ajax syntax for my code is exactly the same.
I will add a “ignore meaning” when a possible value is different from “true” (here and wherever the attribute presence is enough

Comment by Giorgio Braga — November 4, 2005

IIICCCKKKK. As tempted as I am to break standards for all kinds of reasons, most yeilding far more utility than this. The author of this tool claims that these “attributes” are legal. My bet is he believes this because javascript will read the attributes. Silly. DOM parses will read all kinds of gobbly gook that won’t validate against a DTD or schema.

If you are using XHTML 1.1 or XHTML 1.0 Strict putting these attributes in your tags will put your browser in quirksmode and you will loose all the consistant cross browser formatting you gain by using these DTD’s.

This is great if you are working with your own XML applications but don’t call it HTML anymore and be sure to extend the DTD to support your tags.

This isn’t a new idea BTW
http://www.alistapart.com/articles/scripttriggers/

Comment by Vance — November 4, 2005

This looks almost exactly like Dojo. Perhaps we have too many AJAX frameworks?

Comment by Patrick Lightbody — November 4, 2005

Non-standard attributes like this are a tricky question. Personally I don’t mind them provided there is no chance of them clashing with some other attribute added to HTML (or as a browser-specific extension) in the future. Dojo meets this by using a pseudo-namespace: all Dojo attributes have a “dojo:” prefix. If we ever start using XHTML properly (in a few years time when browser support is up to it) we can use proper XML namespaces for this stuff, which are perfectly acceptable from a standards point of view.

Comment by Simon Willison — November 4, 2005

hum, does not work in Safari. What’s worse, you can’t get the list of supported browsers, or the contact page, if you don’t have a supported browser…

Comment by Mike Krus — November 5, 2005

NEED *MORE* EXAMPLE ! ’nuff said.

Comment by matelot — November 5, 2005

They’re posting their JavaScript on the internet, without even a minimum of obfuscation or security, and then trying to charge for it. Brilliant business model, guys.

Comment by anonymous — November 5, 2005

Why isn’t this using it’s own namespace and it’s own dtd?

also – can’t say I can get the justatributes.com to work in either safari or firefox.

Comment by Robb Irrgang — November 5, 2005

Vance is right, this is helpful and there have been a number of other excuses people have concokted in the past to create new or custom HTML atributes, but that’s just not how it works. Unfortunately, the X in XHTML is a lie and that’s the way it is. Custom DTD’s simply make for proprietary code, which is rarely a good thing.

Comment by jason — November 7, 2005

Leave a comment

You must be logged in to post a comment.