[jQuery] Stumped on Tables
> Anyone tired of me yet?
Not me, I'd never heard of Taconite before and the SourceForge pages
certainly are inviting.
http://taconite.sourceforge.net/
But... Well... Just IMO of course...
Here's the AJAX data sent by Taconite's Hello World example:
01 <%@page contentType="text/xml"%>
02
03 <taconite-root xml:space="preserve">
04
05 <taconite-append-as-children contextNodeID="helloWorldContainer"
parseInBrowser="true">
06
07 <div style="font-weight:bold;color:orange;">
08 Taconite says: Hello World!!!
09 </div>
10
11 </taconite-append-as-children>
12
13 </taconite-root>
The only real content is on line 8, all the other stuff is packing peanuts.
That's 1200% overhead if you're counting lines, worse if you count
characters. I know that some of this is just the price you pay for XML in
general, but maybe that argues against XML in general.
Here's Example 3, which demonstrates remote tinkering with the order that
elements appear:
01 <%@ taglib uri="http://taconite.sf.net/tags" prefix="tac" %>
02
03 <tac:taconiteRoot>
04
05 <tac:insertBefore contextNodeID="firstHere" parseOnServer="true">
06
07 <div style="font-weight:bold;color:orange;">
08 I am inserted before!
09 </div>
10
11 </tac:insertBefore>
12
13 <tac:insertAfter contextNodeID="firstHere" parseOnServer="true">
14
15 <div style="font-weight:bold;color:green;">
16 I am inserted after!
17 </div>
18
19 </tac:insertAfter>
20
21 </tac:taconiteRoot>
Why? In AJAX/JSON work that I've done, the data is highly structured; both
the client and server are in sync about what they want to exchange, and it
varies from call to call. It's several rows from a database that will go
into a table, a list of strings for a list box, or a maybe just a single
number that changes the look of some status display. The server makes the
content, status, and policy decisions; the client takes care of presenting
the data.
Taconite seems to want presentation decisions back on the server--it's
basically a parser/interpreter for a server-directed DOM manipulation
engine. Taconite client code stays simple precisely because the server side
code and transmitted XML becomes complex. It does solve, as it says on their
pages, "the potentially tedious task of writing large amounts of JavaScript
to dynamically update the Web page." So does JQuery--without complicating
the server side code or the transmitted data.
As far as the rest of the example parts go, the client side can be done by
JQuery in fewer lines. JQuery doesn't facilitate the server side, but if you
use JSON the server-side support comes from the widely available JSON
libraries. If you use HTML/AHAH, all you need on the server is some basic
string support to build your HTML.
I dunno, maybe I've completely misunderstood Taconite.
> I have a basic version working, replacing only the $.after() function.
> Basically, I'm replacing $.clean() with a smarter version,
> replacing $.cleanspaces with a better trim.
> Any veteran's insight into possible problems with this approach?
Technically it seems like the change to $.clean is the minimum-distance
change to get what you want, but still I think it's the wrong approach for
client-server communication.
Anyone tired of *me* yet? :)
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/