Hello, this is my suggestion for a new html global attribute which would
*Introduction - The problem*
Currently, in order to create dynamic HTML pages, one must use AJAX (
that often makes trivial tasks complex, this has led people to avoid
such as Jquery in an attempt to simplify AJAX. As a result, simple tasks
( Such as fetching weather data every 10 sec) have become complex to
implement and dependent on external bulky libraries.
aax (Pronounced axe) is a proposed AJAX alternative. it adds a single
HTML global attribute called "aax".
The solution is fully backward compatible, clients that don't recognize
the attribute would simply ignore it.
Below are the benefits of the proposal, followed by some quick examples,
followed by a thorough explanation of the proposal, Followed by a
*Benefits in comparison to AJAX*
-Simpler to work with: trivial asynchronous requests should not require
external libraries and/or complex code.
-A standardized way to do asynchronous requests - Yes, XMLHttpRequest is
standardized but people seldom use it directly and everyone uses
external wrappers, so in practice this isn't a standard.
-Much more readable.
In a nutshell: AAX is to AJAX as the video tag is to
- Fetch weather data every 10 seconds and put it inside a div.
<div id="weather" aax="10; /weather.aax">
- Fetch weather data on page load, and then every 10 seconds:
<div id="weather" aax="10; /weather.aax; now">
- Fetch a new content when a menu button is clicked:
<a href="/menuLink1.html" aax="click; /menuLink1.aax;">
The href is for backward-compatibility.
The "current document" is simply the HTML document.
The "fetched document" is the document fetched from the URL specified in
the aax attribute.
The attribute format is as follows:
aax="[interval or click]; [url]; <optional> now; <optional> append;
This fetches an http document from [url] every [interval] seconds (The
fetched document) and uses it to manipulate the current document.
[interval] can optionally be replaced with "click", in this case, the
request occurs when the element is clicked.
The fetched document is an XML page with the following format:
tagx is an arbitrary html tag.
Every element id in the fetched document must match an element id in the
Then, each element in the current document is replaced with its
corresponding element from the fetched document.
now - Additionally fetches the http document when the page loads.
append - Instead of replacing the current document's elements with the
replacement elements specified at the fetched document, we append each
fetched document element's inner HTML to the corresponding current
document element's inner HTML.
prepend - Same as above, except that we prepend.
*A complete example - Dynamically loading an article*
Bob opens example.com, bob receives the following html page:
Bob clicks an article of interest, the element bob clicked is:
<a href="/article14.html" aax="click;/article14.aax">
An interesting article</a>
Bob doesn't have an aax-compatible browser, so Bob simply loads
/article14.html and enjoys the article.
Alice does have an aax-compatible browser. So Alice's browser fetches
article4.aax's content is:
<span id="content"> Today we'd like to announce that...</span>
Alice's browser processes the fetched document and now her document
looks like this:
<span id="content"> Today we'd like to announce that.../div>
On 09/28/2014 06:54 AM, steve wrote:
> No libraries at all work well for me...
rendering routine also works, but a video tag was created anyways.