That's how much you pay attention over links, right? Now please tell me where exactly my solution extends Object.prototype .... the watch method is the simulated one, nobody there extended anything, there is a function, createWatcher.
Regards On Thu, Oct 1, 2009 at 10:55 PM, Michael Geary <[email protected]> wrote: > Extending Object.prototype will break jQuery. > > > On Thu, Oct 1, 2009 at 2:10 PM, Andrea Giammarchi < > [email protected]> wrote: > >> You could use Object.prototype.watch, compatible with IE with my >> createWatcher strategy ... this is not strictly jQuery related, but it >> worked for me, hope it will help: >> >> http://webreflection.blogspot.com/2009/01/internet-explorer-object-watch.html >> >> Regards >> >> >> On Tue, Sep 29, 2009 at 3:50 PM, Nathan Bubna <[email protected]> wrote: >> >>> >>> The only thing i can think of offhand is to set up an interval that >>> checks for modifications and fires an event when it detects one. >>> Seems like a pretty heavy solution though. >>> >>> As for the JSON-DOM binding, the Values plugin does that and can >>> handle complex (nested, arrays, etc) objects too. >>> http://plugins.jquery.com/project/Values >>> >>> On Mon, Sep 28, 2009 at 11:49 PM, Cory <[email protected]> wrote: >>> > >>> > Hi All, >>> > >>> > I'm new to the discussion boards so my apologies if this question has >>> > been answered, (I searched but maybe I wasn't calling it the right >>> > thing.) >>> > >>> > I'd like to create a JSON backing data structure that will update a >>> > DOM element when updated itself. I've seen tons of examples on how to >>> > create custom events to fire when the DOM changes, but not when the >>> > JSON object is modified. >>> > >>> > I have a simple Observer/Observable pattern setup to update the DOM >>> > whenever one of the "registered" elements' backed data is modified, >>> > but it far from elegant. >>> > >>> > Is there a simple solution to this? >>> > >>> > ex: >>> > >>> > data = { >>> > name: "Cory", >>> > hobbies: "coding", >>> > age: 28 >>> > } >>> > >>> > and >>> > >>> > <div bindname="name">Fred</div> >>> > <textarea bindname="hobbies">cutlery</textarea> >>> > <input type="text" bindname="age" value="22"></input> >>> > >>> > when any of the JSON fields change, it updates the DOM. >>> > >>> > > >>> > >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" 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-dev?hl=en -~----------~----~----~----~------~----~------~--~---
