<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I 2nd Dan's idea. What has made me wary about dipping into using
LiveQuery is:
1. loss of an element of control, compared to just calling a helper
function at the right time to rebind events
2. concern about overhead, since (as I understand it), it's watching
for DOM changes and hence maybe not rebinding things in as efficient a
manner as I would want. This concern could just come from not knowing
(or having looked at) how it works under the covers, but I'd have to
make time for that, to ease my concerns
3. concern about possibly rebinding things that I don't want rebound,
so I'd have to write code to prevent it, ending up with around as much
code as just rebinding via my helper function
- Jack
Dan G. Switzer, II wrote:
<blockquote cite="mid:020f01c81c8d$20271da0$0a01a8c0@dreamtheater"
type="cite">
<pre wrap="">I think what I'd be more interested is having a method that would allow me
to really easily *manually* re-apply effects/events to a jQuery object.
For example:
$('li')
.cache('some.name', function(){
// use the helper function hover to bind a mouseover and mouseout event
$(this)
.hover(function() {
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});
});
Now you could do:
$('li').applyCache('some.name');
Something like that would definitely save me some coding. (I'd allow a
manual cache "key", just so you could re-use the chain on other selectors.)
The benefit is you don't have the overhead of having to constantly monitor
the DOM, but you have an easy way to re-apply a bunch of commands to a
selector.
Right now I just use helper functions--which isn't hard, just not very
jQueryish. :)
Too bad there's no way to programmatically know the jQuery chain. It would
be really sweet to be able to do:
$('li')
.hover(function() {
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
})
.cache('some.name');
And have the cache() method be aware of all the methods called in the
current chain.
-Dan
</pre>
<blockquote type="cite">
<pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:jquery-en@googlegroups.com">
jquery-en@googlegroups.com</a> [<a class="moz-txt-link-freetext" href="mailto:jquery-en@googlegroups.com">mailto:jquery-en@googlegroups.com</a>] On
Behalf Of tlphipps
Sent: Thursday, November 01, 2007 9:22 AM
To: jQuery (English)
Subject: [jQuery] Re: LiveQuery (Discuss Please)
I'd like to second this opinion. I'm using livequery more and more,
but there are plenty of places where I DON'T use it, so not having it
in the core would still be my preference.
On Nov 1, 5:53 am, James Dempster <a class="moz-txt-link-rfc2396E" href="mailto:letss...@gmail.com"><
letss...@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">My less than one pence worth would be I love and use the plugin, but I
don't think it should be included into jQuery core, I would
like to see jQuery core stay light and fresh. There's nothing wrong
with adding LiveQuery yourself, either just add another js file to
your html or append all the plugins you want to the same js file.
/James