[JSMentors] Re: Object Declaration Question

2011-12-12 Thread RobG
On Dec 9, 1:30 am, Jake Verbaten rayn...@gmail.com wrote: It would be great if people didn't answer with _completely_ wrong solutions. Before you recommend an answer please run it in a JavaScript console to check it works. As an aside to those who said `this.a` it may time you learned how

[JSMentors] Re: Object Declaration Question

2011-12-12 Thread RobG
On Dec 9, 5:27 am, Nick Morgan skilldr...@gmail.com wrote: Here's an example: function makeAnObject() {     var outerThis = this;     return {       a: this,       b: function () {         return this;       }    }; } When you call makeAnObject as a function, the `this` that `a`

[JSMentors] Re: Jquery fadein Issue

2011-11-08 Thread RobG
On Nov 4, 5:13 pm, Rohit Mehta rohitrmeht...@gmail.com wrote: How to fadeIn page only after the whole page loads(bg, images etc.) I am buildinghttp://www.socialsupply.co The page fades in before the content is loaded. I want the page to fade in only after the content is loaded. I will be

[JSMentors] Re: Why isn't for-in loop looking into prototypes

2011-11-02 Thread RobG
On Nov 1, 7:06 pm, Anoop gupta.anoop.ku...@gmail.com wrote: As per the MDN documentation: A for...in loop does not iterate over non–enumerable properties. Objects created from built–in constructors like Array and Object have inherited non–enumerable properties from Object.prototype and

[JSMentors] Re: String Concatenation Performance

2011-10-18 Thread RobG
On Oct 15, 6:25 am, Jess Jacobs simulacran.h...@gmail.com wrote: Hello everyone, I ran into an interesting issue while trying to prove that adding string concats to a long running string simply to fit the 80 char/line idea was not a good thing.

[JSMentors] Re: String Concatenation Performance

2011-10-18 Thread RobG
On Oct 19, 10:58 am, RobG rg...@iinet.net.au wrote: On Oct 15, 6:25 am, Jess Jacobs simulacran.h...@gmail.com wrote: Hello everyone, I ran into an interesting issue while trying to prove that adding string concats to a long running string simply to fit the 80 char/line idea

[JSMentors] Re: Problem with global object

2011-08-25 Thread RobG
On Aug 23, 11:06 pm, Nick Morgan skilldr...@gmail.com wrote: [...] The function declaration `createUniqueId` is effectively hoisted to the top of the script, so it actually *is* defined before you add the `counter` property to it. Not a big fan of that expression (hoisted). It might be what

[JSMentors] Re: Accessing private vars in the revealing module pattern

2011-08-21 Thread RobG
On Aug 21, 5:10 am, Peter van der Zee jsment...@qfox.nl wrote: On Sat, Aug 20, 2011 at 8:22 PM, Nick Morgan skilldr...@gmail.com wrote: Hi guys Thought I'd share a little toy I just made, to see what you thought: ... It gives you access to the value of private vars via a safe eval.

[JSMentors] Re: Cyclic prototype chain

2011-07-20 Thread RobG
On Jul 20, 10:10 pm, Xavier MONTILLET xavierm02@gmail.com wrote: Oh. Never thought if that... When i implement constructors that are lists somehow, i do this : function Constructor( array ) { Array.prototype.splice.apply( this, [ 0, 0 ].concat( array ) ); } There are a few issus

[JSMentors] Re: Parameters vs. Objects as Parameters

2011-07-04 Thread RobG
On Jul 4, 7:34 pm, David Marrs d.ma...@gmail.com wrote: [...] P.S. Please let me know if my MUA is a bit rubbish for mailing lists. nbsp;I noticed the formatting of my email in your quotes was a bit ugly. I'm using Google Groups, your replies are not well formatted at all: URL:

[JSMentors] Re: Javascript data-driven simple webpage

2011-07-03 Thread RobG
On Jun 29, 8:45 pm, Andrés Maneiro andres.mane...@gmail.com wrote: Hello, I'm starting to develop a simple webpage intensive in data. Let me explain a bit what I need: - The front-end will be a simple webpage with several tables and one combobox. The values in the tables will change

[JSMentors] Re: Parameters vs. Objects as Parameters

2011-07-03 Thread RobG
On Jul 2, 5:38 pm, David Marrs d.ma...@gmail.com wrote: On 2 Jul 2011 01:13, Jason Mulligan lt;attac...@gmail.comgt; wrote: yes i am. extjs/jquery are fantastic examples of this paradigm gone wrong. the syntax ends up on multiple lines as you try to figure out I think the issue is that

[JSMentors] Re: Parameters vs. Objects as Parameters

2011-07-03 Thread RobG
On Jul 2, 7:00 pm, Nick Morgan skilldr...@gmail.com wrote: On 2 July 2011 01:13, Jason Mulligan attac...@gmail.com wrote: and, just to prove my point .. show me a built in function that expects an object as a param. Are you saying that we should be modelling our APIs on the ones

[JSMentors] Re: Parameters vs. Objects as Parameters

2011-06-20 Thread RobG
On Jun 21, 4:07 am, Jason Mulligan attac...@gmail.com wrote: Considering the language, sending an object of args is going against the convention of JavaScript due to laziness. You've lost me. Are you saying passing an object is lazy? -- Rob -- To view archived discussions from the original

[JSMentors] Re: Parameters vs. Objects as Parameters

2011-06-18 Thread RobG
On Jun 17, 9:10 pm, xavierm02 xavierm02@gmail.com wrote: [...] Apparently, it's just a bit slower than normal parameters (in the worst case where all paramaters change each time) :http://jsperf.com/parameters-incidence There is something seriously wrong with those tests - is IE 8 really

[JSMentors] Re: Interesting usage patterns for void operator?

2011-06-14 Thread RobG
On Jun 9, 9:30 am, Anton Kovalyov an...@kovalyov.net wrote: I used the void operator today in a case when I needed to call a function, discard its return value and then return undefined. I did that mostly to be able to omit curly braces in the one-line if statement (i personally think

[JSMentors] Re: Interesting usage patterns for void operator?

2011-06-12 Thread RobG
On Jun 9, 9:30 am, Anton Kovalyov an...@kovalyov.net wrote: I used the void operator today in a case when I needed to call a function, discard its return value and then return undefined. I did that mostly to be able to omit curly braces in the one-line if statement (i personally think

Re: [JSMentors] Re: Prototype chain can't get Object() ?

2011-06-10 Thread RobG
On Thursday, 9 June 2011 22:25:34 UTC+10, Stefan Weiss wrote: On 09.06.2011 01:23, RobG wrote: A function's this keyword is never empty, it*always* references an object. ... unless you're running in strict mode. (function () { use strict; console.log(typeof

[JSMentors] Re: Prototype chain can't get Object() ?

2011-06-10 Thread RobG
On Jun 9, 6:12 pm, David Marrs d.ma...@gmail.com wrote: On 9 Jun 2011 00:23, RobG rg...@iinet.net.au wrote: On Jun 9, 2:34 am, David Marrs d.ma...@gmail.com wrote: [...] [1] it actually passes the function F's special 'this' object, which in the above example is empty

[JSMentors] Re: Generating javascript classes from XSD schema

2011-06-08 Thread RobG
On Jun 7, 7:09 pm, sglai suising@gmail.com wrote: Following is a post at http://objectmix.com/javascript/23091- generating-javascript-classes-xsd-schema.html. Google Groups munges URLs unless they are formatted per the old Usenet format (there's an RFC reference somewhere...): URL:

[JSMentors] Re: Prototype chain can't get Object() ?

2011-06-08 Thread RobG
On Jun 8, 8:45 pm, Adam hitsthi...@gmail.com wrote: Very much. Not all browsers expose the real prototype of an object, I think there is some confusion here between a constructor's public prototype property and an object's private [[prototype]] property (noting that all functions are

[JSMentors] Re: Prototype chain can't get Object() ?

2011-06-08 Thread RobG
On Jun 9, 2:34 am, David Marrs d.ma...@gmail.com wrote: [...] function F(){}; F.prototype = {foo: 'Alice', bar: 'Bob'}; var a = new F(); var b = new F(); If you inspect a or b in firebug (or equivalent) you will see object {foo: 'Alice', bar: 'Bob'}; Now try: a.foo = 'Carol'; If you

[JSMentors] Re: HTML11

2011-06-05 Thread RobG
On Jun 3, 1:58 am, Ben Barber barber...@gmail.com wrote: On Wed, Jun 1, 2011 at 6:50 PM, austincheney austin.che...@travelocity.comwrote: On Jun 1, 5:26 pm, Andrew Dodson andrew.j.dod...@gmail.com wrote: I was looking athttp://www.html11.org/ http://www.html11.org/And wondered if

[JSMentors] Re: Sorting the properties of an object?

2011-06-02 Thread RobG
On May 27, 11:42 pm, Martin Honnen martin.hon...@gmail.com wrote: Bj rn S derqvist wrote: I managed to make a function which seems to work. But basically you're saying that even if the following code seems to work in my browser, I shouldn't rely on it to work? To give you an example,

[JSMentors] Re: querySelectorAll

2011-06-01 Thread RobG
On Jun 1, 11:58 am, Nathan Sweet nathanjsw...@gmail.com wrote: Basically all your posts. Rob, please read through an entire list before posting. You posted a lot of redundant information that Diego, et al went over already. Please point out the redundancy. The comment that: Also there are

[JSMentors] Re: querySelectorAll

2011-05-31 Thread RobG
On May 29, 6:42 pm, Diego Perini diego.per...@gmail.com wrote: Nathan, the querySelectorAll method exists also on IE 8 in Standard Mode. In all IE versions 9 there are problem with the Universal selector since their API methods returns text nodes included in the result set. This is not

[JSMentors] Re: Zakas Blog == Censored

2011-05-23 Thread RobG
On May 21, 6:09 pm, Asen Bozhilov asen.bozhi...@gmail.com wrote: Via the JSMentors mailing list you can: Discuss ECMA-262 standard Discuss different implementations of ECMA-262 Discuss different host environments of JavaScript Discuss implementation of algorithms in JavaScript Discuss

[JSMentors] Re: Zakas Blog == Censored

2011-05-23 Thread RobG
On May 23, 10:08 pm, Rey Bango reyba...@gmail.com wrote: Actually, it does Rob. All this top-posting. Presumably that is in replying to: On Mon, May 23, 2011 at 2:53 AM, RobG rg...@iinet.net.au wrote: [...] There is nothing in the JSMentors Google Groups profile that links to the page

[JSMentors] Re: Detect that window is maximized

2011-05-20 Thread RobG
On May 18, 11:34 pm, Konstantin Breu konstantin.b...@gmx.net wrote: Hi, I am searching for a cross browser implementation which checks whether the current window is maximized? And an implementation which opens a popup maximized (!=fullscreen in IE). Does anyone have hints for that? Some

[JSMentors] Re: Bug in Google Chrome 11 - Array.prototype.indexOf

2011-05-08 Thread RobG
On May 8, 12:56 pm, J.R. jrs_5...@yahoo.com.br wrote: [...] Well, I was having a mysterious problem with indexOf returning a wrong value. After testing with FF4, I decided to go back to Chrome's console (Ctrl + Shift + J) and typed [0, false, 15].indexOf(false); // console returned 0

[JSMentors] Re: Flow - reviewing and sharing my new library

2011-05-03 Thread RobG
On Apr 26, 10:33 pm, Stefan Weiss we...@foo.at wrote: On 26/04/11 05:08, bemson wrote: My name is Bemi Faison. I'm the author of Flow, a framework for defining and executing related functions. (https://github.com/bemson/Flow/ ) I'm of the notion that the concept is more valuable than

[JSMentors] Re: Flow - reviewing and sharing my new library

2011-05-03 Thread RobG
On Apr 27, 1:27 am, bemson bem...@gmail.com wrote: Hey Stefan, Yes, though it works in every browser today, depending on the order of object-properties was a conscious risk. Naturally, a future version could use a dual implementation that considered arrays of object- collections - the same

[JSMentors] Re: Knockout.js and JavascriptMVC (Jupiter) and functional javascript

2011-05-01 Thread RobG
On May 2, 1:40 am, John asp.netp...@gmail.com wrote: Hello i look at thoose libraries. Can you say to me. Is it good to use this libraries both in one project, or it is overhead and complex? Seems to me there was a move some time ago to get away from inline listeners (i.e. using HTML

[JSMentors] Re: Best practices concerning references inside nested objects

2011-03-24 Thread RobG
On Mar 24, 9:25 am, RobG rg...@iinet.net.au wrote: [...] Works in Chrome, maybe some others, not Firefox or IE so not useful yet. Function.prototype.bind is in Firefox 4. -- Rob -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com

[JSMentors] Re: Best practices concerning references inside nested objects

2011-03-23 Thread RobG
On Mar 23, 11:43 pm, Poetro poe...@gmail.com wrote: 2011/3/23 pnbv p.bacelar.vasconce...@gmail.com: Considering a single instance object: app = {    foo: 'afoo',    bar: 'abar',    callbackLib: {        replyFoo: function () {            console.log(this.foo);        },      

[JSMentors] Re: Problem removing event listener?

2011-03-23 Thread RobG
On Mar 24, 1:43 am, Poetro poe...@gmail.com wrote: jQuery adds a wrapper around callback functions, and also collects them to data object. It also adds a non-standard property so it can identify the element that it added the listener to (which in IE means also adding an HTML attribute).

[JSMentors] Re: Extending built-in objects with properties

2011-03-20 Thread RobG
On Mar 21, 5:17 am, Jarek Foksa ja...@kiwi-themes.com wrote: I do a lot of operations on objects retrieved by querySelector() and simillar DOM methods, so I thought it would be nice to extend the built-in Element object with some useful methods and properties. Don't do that. Do not mess with

[JSMentors] Re: Extending built-in objects with properties

2011-03-20 Thread RobG
On Mar 21, 11:50 am, RobG rg...@iinet.net.au wrote: On Mar 21, 5:17 am, Jarek Foksa ja...@kiwi-themes.com wrote: I do a lot of operations on objects retrieved by querySelector() and simillar DOM methods, so I thought it would be nice to extend the built-in Element object with some useful

[JSMentors] Re: Edge cases with function declarations

2011-03-17 Thread RobG
On Mar 16, 9:37 pm, Peter van der Zee jsment...@qfox.nl wrote: On Mon, Mar 14, 2011 at 12:06 PM, Bruno Jouhier bjouh...@gmail.com wrote: Is this behavior precisely defined by the ECMAScript standard, or is it left open to interpretation? Enter Yuri or Dmitry ;) There are a number of

[JSMentors] Re: Array and for/in syntax

2011-03-17 Thread RobG
On Mar 18, 8:22 am, Diego Perini diego.per...@gmail.com wrote: On Thu, Mar 17, 2011 at 3:01 AM, RobG rg...@iinet.net.au wrote: On Mar 17, 10:47 am, RobG rg...@iinet.net.au wrote: On Mar 17, 10:40 am, RobG rg...@iinet.net.au wrote: [...] Try this in various browsers: (function

[JSMentors] Re: Pushing to Arrays

2011-03-16 Thread RobG
On Mar 16, 8:43 pm, Rob Griffiths r...@bytespider.eu wrote:  Why it is better to use a function instead of direct access? It's not always better. Where better is not defined. If the OP means faster, then in the linked tests the best method is evenly split between direct access and push().

[JSMentors] Re: Array and for/in syntax

2011-03-16 Thread RobG
On Mar 17, 2:01 am, Michael Geary m...@mg.to wrote: On Wed, Mar 16, 2011 at 4:42 AM, Peter van der Zee jsment...@qfox.nlwrote: ... In fact, for-in is not meant to iterate an array[...] (Note that the order of for-in might look stable but is not specified to be stable. There's some

[JSMentors] Re: Array and for/in syntax

2011-03-16 Thread RobG
On Mar 17, 10:40 am, RobG rg...@iinet.net.au wrote: [...] Try this in various browsers: (function() { [...] })(); Here's one I forgot to add: // How about an array object var arr = []; arr[1] = 'one'; arr[0] = 'two'; show('Is an array in order?\n', arr); As expected, some

[JSMentors] Re: Array and for/in syntax

2011-03-16 Thread RobG
On Mar 17, 10:47 am, RobG rg...@iinet.net.au wrote: On Mar 17, 10:40 am, RobG rg...@iinet.net.au wrote: [...]  Try this in various browsers: (function() { [...] })(); Here's one I forgot to add:   // How about an array object   var arr = [];   arr[1] = 'one';   arr[0] = 'two

[JSMentors] Re: Why eval() is considered insecure?

2011-03-14 Thread RobG
On Mar 14, 1:53 am, Jarek Foksa ja...@kiwi-themes.com wrote: Almost any modern JavaScript book recommends using subscript notation (e.g. object[key]) instead of eval() because of the following three reasons: - evaled code execution is slow - evaled code is less readable than the same code

[JSMentors] Re: Comments critiques on a function/expression please

2011-03-13 Thread RobG
On Mar 13, 9:31 am, Jason Mulligan jason.mulli...@avoidwork.com wrote: Hi, I just released abaaso 1.2 and I'd love some feedback on the global helper, aka $(). It's sole purpose in the lib is to retrieve Elements, it's not like jQuery; all the real code sits in a global namespace. When

[JSMentors] Re: Comments critiques on a function/expression please

2011-03-13 Thread RobG
On Mar 14, 1:34 pm, RobG rg...@iinet.net.au wrote: On Mar 13, 9:31 am, Jason Mulligan jason.mulli...@avoidwork.com wrote:                         var instances = [],                             i         = arg.length;                         while (i

[JSMentors] Re: JavaScript Visualization of Sorting Algorithms

2011-03-10 Thread RobG
On Mar 11, 6:02 am, cancel bubble cancelbub...@gmail.com wrote: Not being a CS guy myself (though I've been asked to do a bubble sort in an interview), I can't really speak for this, but I imagine there are those here who might find this interesting...

[JSMentors] Re: Why the big speed difference in these for loops?

2011-03-09 Thread RobG
On Mar 10, 2:06 am, Stamen Georgiev tuze...@gmail.com wrote: Just wrote a small test at jsperf for testing a for loop to iterate an array of objects:http://jsperf.com/if-with-i If loops are written using simple conditions and logic there is little be gained from optimisation as the loop

[JSMentors] Re: Why the big speed difference in these for loops?

2011-03-09 Thread RobG
On Mar 10, 9:35 am, RobG rg...@iinet.net.au wrote: [...] So in the above case it is clearer and sometimes faster (rarely slower) to write:   while (--i) {     a = b[i];   } Ugh, that will skip the last member, it should have been: while (i--) {a = b[i];} or while (i) {a = b[--i

[JSMentors] Re: Why the big speed difference in these for loops?

2011-03-09 Thread RobG
On Mar 10, 2:18 pm, Chris chrisageo...@gmail.com wrote: Also interesting:http://jsperf.com/if-with-i/5 Accessing it without caching the object from the array in a variable is 94% slower. In what browser? In my IE 6 the one that doesn't store the value is faster (for your tests). Anyway,

[JSMentors] Re: Better ways to code?

2011-03-07 Thread RobG
On Feb 20, 6:58 am, Scott Greenfield jquery@gmail.com wrote: Hello, I feel like I'm a pretty decent JavaScript coder, but I know there is always more to learn.  I wrote a plugin for a plugin, That is, for a jQuery plugin. that enhances and extends the core plugin's functionality.  

[JSMentors] Re: new to JS

2011-03-03 Thread RobG
On Mar 4, 6:37 am, Amit Kumar the...@gmail.com wrote: I think your approach should be first learn using a library (like jQuery), That is not a good way to really learn JS (I'd say it's a really bad way). which will get you building functional apps pretty quickly. I doubt the functional

[JSMentors] Re: Prevent Selection in a select element (without using disabled)?

2011-03-02 Thread RobG
On Mar 3, 6:01 am, wavded wav...@gmail.com wrote: OK this got me a significant performance bump and works in IE (there is like 5800 options in this multi select, don't ask me why): Perhaps you should. 5,800 options in a select sounds like a ridiculous number, how do users find a particular

[JSMentors] Re: Method Invocation at Function Declaration

2011-02-28 Thread RobG
On Mar 1, 2:29 am, Julian Turner julesb...@gmail.com wrote: Hi Rob 1.   Inheritance in JavaScript is implemented through chains of prototype objects, ending ultimately at Object.prototype. Strictly, it ends with the object referenced by the internal [[prototype]] property of

[JSMentors] Re: Method Invocation at Function Declaration

2011-02-27 Thread RobG
On Feb 28, 5:29 am, nathanJsweet nathanjsw...@gmail.com wrote: I've got a really interesting javascript pattern that I've been scratching my head over for a while. I basically understand what is going on with what I'm about to talk about, but I would like a fuller explanation than what I've

[JSMentors] Re: Method Invocation at Function Declaration

2011-02-27 Thread RobG
On Feb 28, 10:39 am, Ionuț G. Stan ionut.g.s...@gmail.com wrote: On February 28, 2011 1:59 AM, RobG wrote: This isn't the interesting thing yet. What is interesting about this function is how it is invoked. You mean called. What's the difference? You're obviously pedantic, but I'd

[JSMentors] Re: Using Adapter Design Pattern to get a standard API

2011-02-22 Thread RobG
On Feb 22, 9:45 pm, Diego Perini diego.per...@gmail.com wrote: On Tue, Feb 22, 2011 at 3:30 AM, RobG rg...@iinet.net.au wrote: On Feb 22, 12:09 pm, Diego Perini diego.per...@gmail.com wrote: Mark, use event delegation and only setup one listener on the document for the type of event

[JSMentors] Re: Using Adapter Design Pattern to get a standard API

2011-02-21 Thread RobG
On Feb 22, 8:19 am, Mark McDonnell storm.m...@gmail.com wrote: Hi there, I need help understanding the Adapter design pattern so I can help standardise the API usage on a library I'm working on. Let me clarify that I mention the Adapter design pattern but if there is another way to do

[JSMentors] Re: Using Adapter Design Pattern to get a standard API

2011-02-21 Thread RobG
On Feb 22, 12:09 pm, Diego Perini diego.per...@gmail.com wrote: Mark, use event delegation and only setup one listener on the document for the type of event you want notifications. And for those events that don't bubble? -- Rob -- To view archived discussions from the original JSMentors

[JSMentors] Re: Global Object window is no longer this

2011-02-20 Thread RobG
On Feb 18, 11:32 pm, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: On 18.02.2011 6:00, nathanJsweet wrote: So in the new ECMA standard the body decided that when the this word is used at the highest hierarchical level (i.e. when it would normally be the window object) would be

[JSMentors] Re: 'on the fly' object generation

2011-02-17 Thread RobG
On Feb 17, 8:53 pm, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: [...] It to omit initial example, but instead to take a some common abstract, the last case with a function is useful for me. E.g. function foo(callback) {    /* stuff */    callback callback(data); } or even:

[JSMentors] Re: 'on the fly' object generation

2011-02-16 Thread RobG
On Feb 17, 1:40 am, Jason Mulligan jason.mulli...@avoidwork.com wrote: a more complete implementation... Object.prototype.define = function(args, value) {         if (typeof(args) != string) { throw Expected a String; }         args = args.split(.); Unless one of the property names has a

[JSMentors] Re: 'on the fly' object generation

2011-02-16 Thread RobG
On Feb 17, 4:46 am, Jason Mulligan jason.mulli...@avoidwork.com wrote: On Feb 16, 12:58 pm, Andraž Kos andraz@gmail.com wrote: Only unmaintainable code has related variables nested in a mess of various depth. Man, if only that was true... have you seen the shit that ExtJS generates?

[JSMentors] Re: Function expression/statement

2011-02-15 Thread RobG
On Feb 15, 7:12 pm, Peter van der Zee jsment...@qfox.nl wrote: On Tue, Feb 15, 2011 at 9:53 AM, Ivan S ivan.sku...@gmail.com wrote: Hi all. I don't know ECMA script specification so well, so if someone can explain what's the difference between this two: (function() { }());

[JSMentors] Re: Today, Web Development Sucks

2011-02-03 Thread RobG
On Feb 3, 6:39 pm, Guillaume Andrieu gh...@taleo-initiative.org wrote: Hi Rob. A consequence of using most general purpose libraries is that because they only support a small number of current browsers and don't tolerate new browsers very well (a consequence of their poor code quality

[JSMentors] Re: Today, Web Development Sucks

2011-02-02 Thread RobG
On Feb 3, 6:17 am, Guillaume Andrieu subtena...@gmail.com wrote: On 2 February 2011 20:22, Garrett Smith dhtmlkitc...@gmail.com wrote: Hi Garrett. Thanks for your critic eye to this article. But I'd like you to expand a bit on this: JS Libraries are by and for incompetents. I wonder

[JSMentors] Re: JavaScript must die

2011-01-30 Thread RobG
On Jan 31, 9:46 am, cancel bubble cancelbub...@gmail.com wrote: My thesis is that the security situation with JavaScript is so poor that the only solution is to kill it. End users have very little in the way of protection against malicious JavaScript, major web sites suffer from XSS and CSRF

[JSMentors] Re: Method Resolution Order (MRO) for JavaScript?

2011-01-24 Thread RobG
On Jan 25, 5:59 am, mckoss mck...@gmail.com wrote: I've been doing a lot of Python programming, and have found the implementation of multiple-inheritance there to be quite useful and expressive.  Python has a concept of Method Resolution Order (MRO, or more specifically, C3 MRO) - you can

[JSMentors] Re: Saving checkbox state in jquery.

2011-01-19 Thread RobG
On Jan 20, 12:10 am, Diego Perini diego.per...@gmail.com wrote: On Jan 19, 8:29 am, RobG rg...@iinet.net.au wrote: On Jan 19, 1:49 pm, Diego Perini diego.per...@gmail.com wrote: [...] I don't know if there are known problems using these defaultXX DOM properties. Anybody have reasons

[JSMentors] Re: Saving checkbox state in jquery.

2011-01-18 Thread RobG
On Jan 19, 9:33 am, fernando trasvina trasv...@gmail.com wrote: you can also check the W3C DOM spec athttp://www.w3.org/TR/html401/interact/forms.html#adef-checked Attribute definitions checked [CI] When the type attribute has the value radio or checkbox, this boolean attribute

[JSMentors] Re: Saving checkbox state in jquery.

2011-01-18 Thread RobG
On Jan 19, 1:49 pm, Diego Perini diego.per...@gmail.com wrote: On Wed, Jan 19, 2011 at 4:24 AM, Miller Medeiros lis...@millermedeiros.com wrote: On Tue, Jan 18, 2011 at 9:48 PM, Diego Perini diego.per...@gmail.com wrote: as you can see, the .attr(checked, false) may have changed a

[JSMentors] Re: Saving checkbox state in jquery.

2011-01-17 Thread RobG
On Jan 18, 10:01 am, Shawn Stringfield shawn.stringfi...@gmail.com wrote: I'm actually not trying to solve the unknown by using jquery. I was able to save sessions without using any plugins at all or using jquery for that matter and I'm definitely not using jquery as an excuse to not learn

[JSMentors] Re: Saving checkbox state in jquery.

2011-01-17 Thread RobG
On Jan 18, 1:02 pm, Shawn Stringfield shawn.stringfi...@gmail.com wrote: Thanks Rob. I've got a question for you. When you began learning JavaScript which approach did you take? Did you start with becoming familiar with syntax and learning each aspect of the language? Would you recommend

[JSMentors] Re: Improved Module Pattern?

2011-01-01 Thread RobG
On Jan 2, 9:19 am, jemptymethod jemptymet...@gmail.com wrote: On Jan 1, 12:48 am, jemptymethod jemptymet...@gmail.com wrote: Please consider the following template.  Sure its a little verbose, but Uncle Bob declare comments to be failures, so I'm trying to obviate such failure with the

[JSMentors] Re: storing data: DOM or closure?

2010-12-21 Thread RobG
On Dec 21, 7:25 am, raysaun ray.s...@gmail.com wrote: I'm fairly new to JS with no formal training, but I try my best to be conscientious... I notice that in our code base lots of data gets shoved into the browser's DOM. Is that a good idea? For example, a component might perform an AJAX

[JSMentors] Re: Note: Google Groups' Web Interface Requires a Google Account to Post Here

2010-12-17 Thread RobG
On Dec 16, 5:35 am, Balázs Galambosi galambal...@gmail.com wrote: I wonder if google groups is safe from spam... Just look what happened to comp.lang.javascript And who is to blame for that? clj is not a Google Group, it is a Usenet news group. The vast majority of the spam there is from

[JSMentors] Re: Can I dynamically make a prototype link?

2010-12-17 Thread RobG
On Dec 17, 5:37 pm, Juriy Zaytsev kan...@gmail.com wrote: On Thu, Dec 16, 2010 at 11:40 PM, Yu-Hsuan Lai rainco...@gmail.com wrote: [...]     f = function () {}; Another undeclared assignment, leaking `f` to the global scope. Prepend `var` (to make it a function expression) or change to

[JSMentors] Re: Javascript Quizz

2010-12-16 Thread RobG
On Dec 16, 4:21 pm, Amit Agarwal lifea...@gmail.com wrote: *Hi, How about people coming up with brain storming questions in Javascript which need deep understanding of the language and are little painful to think completely. Everything old is new again. If by Javascript you mean ECMA-262,