| From | Sent On | Attachments |
|---|---|---|
| Jacques Le Roux | Oct 13, 2010 1:39 am | |
| Sascha Rodekamp | Oct 13, 2010 5:30 am | |
| Jacques Le Roux | Dec 11, 2010 1:10 am | |
| Sascha Rodekamp | Dec 11, 2010 1:49 am | |
| Adam Heath | Dec 11, 2010 9:51 am | |
| Sascha Rodekamp | Dec 12, 2010 9:43 am | |
| Adam Heath | Dec 12, 2010 10:16 am | |
| Jacques Le Roux | Dec 12, 2010 10:46 am |
| Subject: | Re: jQuery branch | |
|---|---|---|
| From: | Jacques Le Roux (jacq...@les7arts.com) | |
| Date: | Dec 12, 2010 10:46:18 am | |
| List: | org.apache.ofbiz.dev | |
From: "Adam Heath" <doo...@brainfood.com>
Sascha Rodekamp wrote:
yes Adam that's an option if you don't want to type jQuery. each time you uses something from the jQ Library. Hope everyone understands whats going on, here is a little explanation:
Adam tests if jQuery is a valid object and ready to use: if (jQuery)
If the is true he calls a self calling function and pases the jQuery Object. The function parameter name is the $. Within the function you have you're typical jQuery $ shortcut. (function($) { $.globalMethod(); $(selector).instanceMethod(); })(jQuery);
Thanks for for the snippet Adam.
It's not mine, it comes from tons of jquery extensions, and jquery itself. It might even be a recommended best practice, listed somewhere on their site.
Yes, there are other options as well
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
What I wanted to say is to keep it as simple as possible: we use always
"jQuery(" inside OFBiz OOTB (it's not that much to type and
I don't believe we spend much of our time typing) and people can continue to use
all the existing Prototype snippets and their own
with $(
Anyway, I'm open to any other solutions...
Jacques





