Hmm... I'm not completely sold on this yet - but definitely prototyping it with a plugin would be a good way to give it a try.
--John On Fri, Sep 26, 2008 at 2:54 PM, Brandon Aaron <[EMAIL PROTECTED]> wrote: > If this is a common pattern perhaps a new method/plugin could be made to > make the code more explicit. > $('#foo').copy('#bar', 'val'); > $('#foo').copy('#bar', 'text'); > $('#foo').copy('#bar', 'html'); > $('#foo').copy('#bar', 'class'); > $('#foo').copy('#bar', 'css', 'color'); > $('#foo').copy('#bar', 'css', ['color', 'font-family']); > -- > Brandon Aaron > On Fri, Sep 26, 2008 at 1:44 PM, Cloudream <[EMAIL PROTECTED]> wrote: >> >> May cause a little confuse: >> >> $("#one").html( $("#two") ); >> == $("#one").html( $("#two").html() ); or == $("#one").html( $ >> ("#two").val() || $("#two").text() ); ? >> >> What about: >> $("#one").css("color",$("#two")) == $("#one").css("color", $ >> ("#two").css("color") ) >> $("#one").bind("click",$("#two")) == $("#one").bind("click", click >> function of $("#two") ) >> >> :P >> >> On Sep 27, 1:59 am, "John Resig" <[EMAIL PROTECTED]> wrote: >> > I'm curious: Are there any pieces of code that use jQuery, right now, >> > that you feel are unelegant or ugly? (Presumably ones that've already >> > been optimized to the best of their ability.) >> > >> > One area of improvement that I was thinking of was something along the >> > lines of: >> > >> > // ugly >> > $("#foo").val( $("#bar").val() ); >> > >> > // a bit better >> > $("#foo").val( $("#bar") ); >> > >> > this would be an easy change, just make .attr() do something like: >> > >> > if ( arg.jquery ) >> > val = arg.val() || arg.text() || ""; >> > >> > Any other thoughts? I wonder if there are common cases that could be >> > improved with some simple code additions to core. >> > >> > --John >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---