That sounds to me like
$('#Anchor')
.click(function(){
MyNewURL=Somemagic;
$('#Div').load(MyNewURL);
return false;
})
there is no UI component to that you need to rewrite for yourself :-)
On Wed, Oct 22, 2008 at 9:21 PM, Justin <[EMAIL PROTECTED]> wrote:
>
>
> I'm new to jquery and I'm writing some code but I'd like to make sure
> I'm not rewriting something that already exists. Basically, I'd like
> to be able to do:
>
> $("#myAnchor").addBehavior($("#targetDiv", new MyNewBehavior);
>
> Then I implement a few functions for MyNewBehavior such as "buildURL"
> and "stuffToDoAfter". When myAnchor is clicked on, an ajax request is
> made to buildUrl (which might be a static URL or might build the URL
> from parameters), then targetDiv is filled with the html fragment that
> is sent to the "success" function, and finally stuffToDoAfter() is
> executed in case you want to manipulate the newly added elements.
>
> So it abstracts away the click() call, the ajax call, the
> targetDiv.innerHTML = ajaxResponse, etc.
>
> Anyone know if something like this already exists? How do you do this
> sort of thing?
>
> Also I've already realized I needed a function to take in a container
> object such as a table, and addBehavior() to all the td's. Then in the
> buildURL I can build the URL using the td text as a parameter.
>
>
>
>
> >
>
--
Perhaps the depth of love can be calibrated by the number of different
selves that are actively involved in a given relationship.
Carl Sagan (Contact)
Jaime Ochoa Malagón
Arquitecto de Soluciones
Cel: +52 (55) 1021 0774
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---