[JSMentors] Re: jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread MRoderick
Anyone using jslint should really consider all the options available at http://www.jslint.com/lint.html To switch off Crockfords opinion on only having one var declaration per function, add this to the top of the file you're working with: /*jslint onevar:false */ Since it's still in the

[JSMentors] Re: setInterval overhead

2011-01-17 Thread foldi
And, Thanks...relying on new Date().getTime() sounds much more solid than hoping the timers remain consistent. -Vince On Jan 15, 6:37 am, And Clover and-...@doxdesk.com wrote: On Fri, 2011-01-14 at 16:24 -0800, foldi wrote: I have an upcoming project that involves multiple timers and need a

[JSMentors] Re: Detecting and reporting user defined global variables

2011-01-17 Thread cancel bubble
Here's the revised script: http://jsbin.com/ixexi3 -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To

Re: [OT] Re: [JSMentors] Re: Pattern for immediately invoked function - best use of parenthesis (function(){}()); or (function(){})();

2011-01-17 Thread Miller Medeiros
On Mon, Jan 17, 2011 at 9:53 AM, porneL mailingl...@pornel.net wrote: On Mon, 17 Jan 2011 01:45:43 -, Miller Medeiros lis...@millermedeiros.com wrote: I still believe that this analogy fits well.. XML is stricter than HTML and have simpler rules (all tags open and close on a sane

[JSMentors] Multi thread JavaScript + multi core CPU = programming for the future

2011-01-17 Thread Andraz
I want to develop multi core capable JS applications. Even if multi core support is not all around us today it will be soon enough in the good engines to think about it in advance. What is the best way to go about it and which way is the most soon-to-be-parallelized candidate? Event-based

Re: [JSMentors] Multi thread JavaScript + multi core CPU = programming for the future

2011-01-17 Thread Peter van der Zee
On Mon, Jan 17, 2011 at 6:12 PM, Andraz andraz@gmail.com wrote: I want to develop multi core capable JS applications. Even if multi core support is not all around us today it will be soon enough in the good engines to think about it in advance. Hate to burst your bubble there, but there

Re: [JSMentors] Multi thread JavaScript + multi core CPU = programming for the future

2011-01-17 Thread Gary Katsevman
Extensive usage of web worker threads? How to go about DOM manipulation from workers in this case? You cannot do DOM manipulation from within web worker threads. Also, while you do get XMLHttpRequest, the responseXML property is null so you can only get JSON from it. The only way to do DOM

Re: [JSMentors] Multi thread JavaScript + multi core CPU = programming for the future

2011-01-17 Thread Trygve Lie
Hi I want to develop multi core capable JS applications. Even if multi core support is not all around us today it will be soon enough in the good engines to think about it in advance. What is the best way to go about it and which way is the most soon-to-be-parallelized candidate?

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Peter van der Zee
On Mon, Jan 17, 2011 at 7:37 PM, Garrett Smith dhtmlkitc...@gmail.comwrote: ... And for reasons I don't understand, you've top replied to the original post which appears below. Please stop doing that. Thanks. -- To view archived discussions from the original JSMentors Mailman list:

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Garrett Smith
On 1/16/11, Shawn Stringfield shawn.stringfi...@gmail.com wrote: I'm actually experimenting with localStorage and cookies. When a user comes to a page, I will give them the option of seeing the page layout with thumbnails vs. details of images. The layout is based on them clicking a checkbox

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread And Clover
On Sat, 2011-01-15 at 17:38 -0800, Ryan Grove wrote: If another developer comes along and adds some code after the second var statement but before the second loop that assumes that i and/or thing are undefined The chances that someone *wants* to use an undefined variable, and consequently

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread Ryan Grove
On Mon, Jan 17, 2011 at 1:50 PM, And Clover and-...@doxdesk.com wrote: On Sat, 2011-01-15 at 17:38 -0800, Ryan Grove wrote: If another developer comes along and adds some code after the second var statement but before the second loop that assumes that i and/or thing are undefined The chances

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Miller Medeiros
since in your case it seems to be just one, I would just store a single cookie with the name of the setting and since you are already using jQuery search for a cookie plugin, it may help you with the expires and retrieving the proper data.. or you could just use: `document.cookie =

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Garrett Smith
On 1/17/11, Miller Medeiros lis...@millermedeiros.com wrote: since in your case it seems to be just one, I would just store a single cookie with the name of the setting and since you are already using jQuery search for a cookie plugin, JQ plugins are not known for robust. And they tend to have

Re: [OT] Re: [JSMentors] Re: Pattern for immediately invoked function - best use of parenthesis (function(){}()); or (function(){})();

2011-01-17 Thread porneL
On Mon, 17 Jan 2011 16:20:24 -, Miller Medeiros lis...@millermedeiros.com wrote: I totally disagree.. I was just talking about returning the content of a node and it's attributes, nothing about DTD, schema, error handling.. Then it's not XML any more. the serialization process is

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread Garrett Smith
On 1/15/11, And Clover and-...@doxdesk.com wrote: On Fri, 2011-01-14 at 10:12 -0800, cancel bubble wrote: I understand that it's good practice to declare all your vars at the top of your function I disagree. This is one part of Crockford Dogma I think is badly mistaken. It's a habit from

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread Garrett Smith
On 1/17/11, Garrett Smith dhtmlkitc...@gmail.com wrote: On 1/15/11, And Clover and-...@doxdesk.com wrote: On Fri, 2011-01-14 at 10:12 -0800, cancel bubble wrote: \[...] And if it matters, it is possible to make Crockford not be happy by Correction: it is possible to make Crockford not be

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Shawn Stringfield
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 JavaScript but there is absolutely nothing wrong with using them both. To each

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Miller Medeiros
On Mon, Jan 17, 2011 at 6:19 PM, Garrett Smith dhtmlkitc...@gmail.comwrote: On 1/17/11, Miller Medeiros lis...@millermedeiros.com wrote: since in your case it seems to be just one, I would just store a single cookie with the name of the setting and since you are already using jQuery

[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

Re: [JSMentors] Re: Saving checkbox state in jquery.

2011-01-17 Thread Shawn Stringfield
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 just diving straight in with trivial projects? Just trying to get a feel for how

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread Diego Perini
On Mon, Jan 17, 2011 at 11:10 PM, Ryan Grove r...@wonko.com wrote: On Mon, Jan 17, 2011 at 1:50 PM, And Clover and-...@doxdesk.com wrote: On Sat, 2011-01-15 at 17:38 -0800, Ryan Grove wrote: If another developer comes along and adds some code after the second var statement but before the

[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

Re: [JSMentors] Saving checkbox state in jquery.

2011-01-17 Thread Miller Medeiros
On Mon, Jan 17, 2011 at 10:54 PM, Diego Perini diego.per...@gmail.comwrote: On Mon, Jan 17, 2011 at 11:52 PM, Miller Medeiros lis...@millermedeiros.com wrote: $('#my-check-box').attr('checked', true); - should work cross browser if it is a checkbox. and you can check if a checkbox

Re: [JSMentors] jslint Move all 'var' declarations to the top of the function. is now a critical error

2011-01-17 Thread Garrett Smith
On 1/17/11, Ryan Grove r...@wonko.com wrote: On Mon, Jan 17, 2011 at 1:50 PM, And Clover and-...@doxdesk.com wrote: On Sat, 2011-01-15 at 17:38 -0800, Ryan Grove wrote: [...] I agree with you that it would be nice to be able to keep variable declarations as close as possible to where those