On Wed, May 07, 2014 at 03:52:25PM -0400, Karl Dahlke wrote: > My first foray into jquery has me shaking my head. > > https://learn.jquery.com > > I downloaded jquery-1.11.1.js, > and at least it is real code, not minimized. > But what is the point? Yeah, I've only recently started looking into this as well and I'm still unsure. > It reminds me, decades ago, a proff showed me how you could > use the preprocessor to almost turn C into pascal. > > #define begin { > #define end } > etc > > And then he said, "but don't ever do that!" Yeah... I've never seen that done before and hope I never see it in actual code. > jquery seems to be a huge library of functions that overlay prototypes and > all sorts of things to make js more powerful I guess. I'm not so sure it's about making js more powerful, from what I've seen so far it just looks like a way to abstract away the details of web development allowing the use of the latest GUI coding patterns. To my mind, whereas this certainly makes developing web content easier for all those java and similar object oriented programmers out there, it doesn't really increase the power of js. > If we have a perfect js dom implementation then jquery would run just fine, > but we don't. > > My first load of the library gives this error. > > jquery-1.11.1.js: 916: TypeError: document is undefined > > Really? > almost the first thing I do in createJavaContext is make the document object. > It's there from the start, but somehow something in this library has caused > it to disappear. > I haven't had the time or the inclination to track down what has happened. I've not looked through jquery to see if it does this, but I seem to remember seeing the below code a bunch of times in js functions on websites which don't work with edbrowse: var document = some.set.of.js.calls(); I can't remember what went after the = but I remember wondering why anyone would want to define the document variable and being somewhat surprised to see that people actually did this. I think if we can get child nodes working though that'd certainly help. Sorry I don't have more time to look into this at the moment. Cheers, Adam.