I'll go through a few things in the wicket-ajax-ng.js file, to give an
idea how that could look like when putting it on top of jQuery. I skip
all stuff where I can't guess while scanning the code whats its
supposed to do.

W.$ looks like it selects one or more elements by id. Selecting is
completely encapsulated in the jQuery-function, so you would change
the usage a bit:

W.$("myID") == $("#myID").get(0)
W.$("id1", "id2") == $("#id1, #id2").get()

Usually you won't need to reference the DOM elements, so you could
remove the get(0) and get() calls.

W.$$ would just use:

if ($("#id").size() ) {
  // element exists
}

copyArray can be replaced with jQuery.makeArray
(http://dev.jquery.com/browser/trunk/jquery/src/core.js#L1130), which
is heavily optimized and takes stuff like passing window as an
argument into account.

iterateArray could be replaced with jQuery.each, though the symantics
are slightly different. jQuery.each iterates over both objects and
arrays.

The GarbageCollector wouldn't be necessary: jQuery cleans up all event
listeneres when removing elements from the DOM. You don't have to
bother with that at all.

Like I mentioned earlier, replaceOuterHtmlXXX shouldn't be necessary
at all, jQuery handles that automatically for all DOM manipulation
methods.

mapToUrlParameters would be handled by jQuery.param. Though usually
when using jQuery's ajax methods, you don't have to worry about that.
For example, to post some parameters to the server, you'd just use
jQuery.ajax with the data option:

$.ajax({
  url: ...,
  method: "post"
  data: {
    key1: "value1",
    key2: "value2"
  }
});

And so far I've covered only jQuery core functionality. What do you think?

Jörn

On Mon, Sep 29, 2008 at 11:50 PM, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Okay, let's keep this focused.
> Here is my experimental branch.
>
> http://svn.apache.org/repos/asf/wicket/sandbox/knopp/experimental/
>
> There is new Ajax implementation here:
>
> http://svn.apache.org/repos/asf/wicket/sandbox/knopp/experimental/wicket/src/main/java/org/apache/_wicket/ajax/js/wicket-ajax-ng.js
>
> and the main AjaxBehavior here:
>
> http://svn.apache.org/repos/asf/wicket/sandbox/knopp/experimental/wicket/src/main/java/org/apache/_wicket/ajax/AjaxBehavior.java
>
> What I'd like to hear is what exactly is wrong with it and how using
> jQuery (or any other framework for that matter) could improve things.
>
> -Matej
>
> On Mon, Sep 29, 2008 at 11:45 PM, Martijn Dashorst
> <[EMAIL PROTECTED]> wrote:
>> On Mon, Sep 29, 2008 at 11:13 PM, Jörn Zaefferer
>> <[EMAIL PROTECTED]> wrote:
>>> PS: I'm currently sitting on a panel with PPK and guys from Prototype,
>>> Dojo, YUI and jQuery. One question was: "What library would you
>>> recommend but your own?". Two of the three non-jQuery guys recommened
>>> jQuery
>>
>> So you're saying that 75% of the leading JS framework community think
>> jquery is second best.
>>
>> Please keep the jquery marketing BS and fanboyism to the jquery
>> forums. It serves nobody any good. In fact it makes me cringe and want
>> to -1 any and all votes for adopting anything near jquery.
>>
>> Martijn
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to