Re: [JSMentors] Naming convention for constants

2012-01-12 Thread Poetro
. You can even modify it to some degree to make it fit your team's development style (like switch camelCase to something else, or use Hungarian notation or whatever your team prefers), just stick to it, and it will help in the rest of the development process. -- Poetro -- To view archived

Re: [JSMentors] Re: Now you see it, now you don't (please don't hide content by default)

2011-12-23 Thread Poetro
: am I on the right track? Claus -- Poetro -- 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 unsubscribe

Re: [JSMentors] How do you automatically minify your client JS files?

2011-12-06 Thread Poetro
, there might even be one that does this for you. off: posting a question to several list doesnt look to be a good idea. -- Poetro -- 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

Re: [JSMentors] List of great video lectures, articles and book in JavaScript ?

2011-12-06 Thread Poetro
the good parts is not on your top 3 list :( I personally dont like that book, and Stoyan Stefanov's book (JavaScript Patterns) talks about the same things (plus a lot more). So if you've read JavaScript Patterns then it The Good Parts wont too much extra. -- Poetro -- To view archived

Re: [JSMentors] Re: passing external resources like images, stylesheets, etc to a Node app

2011-11-26 Thread Poetro
server so that it checks if a file exists before serving it? On Nov 25, 1:51 am, Poetro poe...@gmail.com wrote: 2011/11/25 dtang85 dtan...@gmail.com: Are there any good resources you can recommend for learning Node? The documentation is a bit overwhelming. Node.js -http://nodejs.org/ npm

Re: [JSMentors] passing external resources like images, stylesheets, etc to a Node app

2011-11-23 Thread Poetro
(request, response); } }); I'll leave the rest of the logic up to you. -- Poetro -- 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

Re: [JSMentors] Need help with this effect

2011-11-03 Thread Poetro
to remove them, just unbind the click handlers from the element. -- Poetro -- 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

Re: [JSMentors] Need help with this effect

2011-11-03 Thread Poetro
2011/11/3 Rohit Mehta rohitrmeht...@gmail.com: Thanks poetro..i knw the css part of it. The toggle function is clear to me now.. I was confused with speed parameter in it and so mycode was not working.. How to create the drag and drop and expanding boxes when clicked ? If you still want

Re: [JSMentors] Re: Variable scope/timing issue w/ ajax within a JavaScript module

2011-09-15 Thread Poetro
, that will be called when a the AJAX data is loaded. You even specify one callback for the 'complete' attribute, that will be called when the AJAX loading is 'complete'. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors

Re: [JSMentors] Variable scope/timing issue w/ ajax within a JavaScript module

2011-09-14 Thread Poetro
jQuery already to fill in default values? http://api.jquery.com/jQuery.extend -- Poetro -- 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

Re: [JSMentors] Should XmlHttpRequest Response Be HTML or JSON?

2011-09-11 Thread Poetro
is much costly then parsing a JSON string, and you only need to do the parsing once, since then it will be native. Although generating DOM from that JSON can be costly, but that also needs to be done once. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] Re: WebGl shape recognition

2011-09-08 Thread Poetro
that if their examples don't work from firefox it's probably alpha code. Patrick They worked for me in Firefox, Chrome, Opera and even IE9 if i set the appropiate HTML Doctype. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors

Re: [JSMentors] Fun interview question with function expressions

2011-09-07 Thread Poetro
, which has a broken implementation of the spec). Read Dmitry Soshnikov's explanation on the subject. http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/#function-expression -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com

Re: [JSMentors] spaces in attribute values

2011-09-06 Thread Poetro
as a brace, ], delimits the whole selection. jQuery('[class=first last]') works fine on li class=first last and same should go for anything else. Same goes to jQuery('[name=my fancy[] stuff]') with a name=my fancy[] stuff -- Poetro -- To view archived discussions from the original JSMentors

Re: [JSMentors] spaces in attribute values

2011-09-06 Thread Poetro
[a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com

Re: [JSMentors] Fun interview question with function expressions

2011-09-06 Thread Poetro
will result in a ReferenceError. In case of Fx the result will be REALLY weird, as it was a list of plugins for me. In IE it will most likely produce the number 123. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com

Re: [JSMentors] Fun interview question with function expressions

2011-09-06 Thread Poetro
2011/9/6 gaz Heyes gazhe...@gmail.com: On 6 September 2011 19:12, Poetro poe...@gmail.com wrote: 2011/9/6 gaz Heyes gazhe...@gmail.com: I found this which was quite surprising: !function x(){x=123;alert(x);}() What's the value of x without running the code? The value of x depends

Re: [JSMentors] Re: Accessors in JavaScript

2011-08-26 Thread Poetro
for undefined, why not check if it is in the object: return name in getters ? getter( name, object ) : storage[ name ]; and return name in setters ? setter( value, name, object ) : storage[ name ] = value; -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] changing the URL without a page refresh

2011-08-13 Thread Poetro
to check for the hash change (and also there are plugins / frameworks for that). -- Poetro -- 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

Re: [JSMentors] Reading Java Script File contents

2011-08-02 Thread Poetro
2011/8/2 sim williams bigsimsi...@gmail.com: Hi All, I would like to be able to read the contents of a JavaScript file. You should load the file via AJAX, then you can read the content of the response. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] URL Blocker

2011-08-02 Thread Poetro
system. -- Poetro -- 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 unsubscribe from this group, send email

Re: [JSMentors] Re: Reading Java Script File contents

2011-08-02 Thread Poetro
2011/8/2 sim williams bigsimsi...@gmail.com: Thanks Poetro Would this be possible for cross domain files? Thanks Only if both your browser and the third party do support cross domain ajax (http://www.w3.org/TR/XMLHttpRequest2/). In any other cases you would need a proxy (written in your

Re: [JSMentors] Re: Best framework to small projects

2011-07-25 Thread Poetro
be for this, is to modify / monkey patch the frameworks so they use a common utility library (like Underscore.js). -- Poetro -- 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

Re: [JSMentors] new implementation

2011-07-16 Thread Poetro
: An implementation of new using new is kind of weird... -- Poetro -- 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

Re: [JSMentors] JavaScript architecture

2011-07-12 Thread Poetro
('myevent.mycomponent', args). Same goes for the unsubscribe. -- Poetro -- 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

Re: [JSMentors] Re: Why this Global Object is not Found in the Firebug Console (Throws Error)

2011-07-04 Thread Poetro
debug is a convinence function in firebug so you may not be able to overwrite it, or get it to user your user defined function. http://getfirebug.com/wiki/index.php/Command_Line_API#debug.28fn.29 -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] Why this Global Object is not Found in the Firebug Console (Throws Error)

2011-07-04 Thread Poetro
/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] Detect focus of an iframe

2011-07-01 Thread Poetro
or semi transparent div on top of everything, that covers the whole page, and put your overlay above that. The div could would handle all the click events and react to it. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors

Re: [JSMentors] SICP-style streams, and the Sieve of Eratosthenes

2011-06-30 Thread Poetro
); while (n--) { console.log(fib.next()); } }(10)); }}} Output: {{{ 1 2 3 5 8 13 21 34 55 89 }} -- Poetro -- 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

Re: [JSMentors] Re: Parameters vs. Objects as Parameters

2011-06-18 Thread Poetro
of the script doesnt really run. http://jsperf.com/parameters-incidence/2 should give better results. -- Poetro -- 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

Re: [JSMentors] Post using XMLHttpRequest

2011-06-15 Thread Poetro
: value}).join('')); -- Poetro -- 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 unsubscribe from this group

Re: [JSMentors] Spreadsheet view in rails + share options

2011-06-13 Thread Poetro
there is the jqGrid and DataTables plugins, there is one for ExtJS and most probably any framework you can find that has a recent version will have one. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non

Re: [JSMentors] Code structuring and why...

2011-06-13 Thread Poetro
/essentialjsdesignpatterns and there are books like Pro JavaScript Design Patterns, JavaScript Patterns. -- Poetro -- 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

Re: [JSMentors] HTML11

2011-06-01 Thread Poetro
2011/6/2 Andrew Dodson andrew.j.dod...@gmail.com: I was looking at http://www.html11.org/ And wondered if the religion element will expose a save() method with a callback handler. This is a joke right? -- Poetro -- To view archived discussions from the original JSMentors Mailman list

Re: [JSMentors] Re: When to use prototype to extend a function?

2011-05-25 Thread Poetro
inside MyClass1 would change a newly initialized object. If you call it with just MyClass1() then the `this` will be the global object and it will not recieve any of the prototype functions. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail

Re: [JSMentors] Detect that window is maximized

2011-05-18 Thread Poetro
it is a good UX if/when an application resizes my windows. Also the popups are also a bad thing and should only be used if there is no other way to implement something (I'd doubt). -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors

Re: [JSMentors] How to access Object.prototype from Object.prototype.b.c()?

2011-05-17 Thread Poetro
); return array; } return array; }, set: function () {}, enumerable: false }); myArray.b.c(); -- Poetro -- 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

Re: [JSMentors] How to access Object.prototype from Object.prototype.b.c()?

2011-05-17 Thread Poetro
}); -- Poetro -- 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 unsubscribe from this group, send email to jsmentors

Re: [JSMentors] Re: UTF-8 to Unicode conversion in ajax response

2011-05-17 Thread Poetro
What HTTP headers does your server side script sends to the client? Does it send the right Content-type header along with a charset? -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non

Re: [JSMentors] Blog post on closures in JavaScript

2011-04-26 Thread Poetro
will be defined at the begining of the function, the position of the definition doesnt really matter. So I dont really understand what you mean by this. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via

Re: [JSMentors] how to get cookie DSID ?

2011-04-19 Thread Poetro
the DSID from the url? Thanks! Jim Cookies are saved to a file. If you can figure out where your browser saves that cookie file, write a script that parses those cookie files, and collect that DSID whatever that is. -- Poetro -- To view archived discussions from the original JSMentors Mailman

Re: [JSMentors] Just how efficient are JS function calls?

2011-04-14 Thread Poetro
efficient then loading it via JavaScript, as it doesn't block the rendering of the page, but it has a different meaning. -- Poetro -- 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

Re: [JSMentors] Re: Best practices for opening new window (pop up or pop under) with JavaScript

2011-04-13 Thread Poetro
('!DOCTYPE HTMLhtml lang=en-USheadmeta charset=UTF-8title' + message + '/title/headbody' + message + '/body/html'); doc.close(); And then when some event happens, just: win.location.replace('http://www.example.com/'); -- Poetro -- To view archived discussions from

Re: [JSMentors] Re: Best practices for opening new window (pop up or pop under) with JavaScript

2011-04-13 Thread Poetro
2011/4/13 Scott Sauyet scott.sau...@gmail.com: Poetro wrote:     win = window.open('javascript:' + encodeURIComponent(message) + '', yourwindow),     doc = window.document; presumably `doc = win.document`, right? Ah yes, tnx for finding the typo. -- Poetro -- To view archived

Re: [JSMentors] Object(null)

2011-04-03 Thread Poetro
2011/4/2 Dmitry A. Soshnikov dmitry.soshni...@gmail.com: On 03.04.2011 1:38, Poetro wrote: 2011/3/29 alexisacoudey...@gmail.com: var k = null; Object(k) === k --  false (in Chrome and FF4). I don't understand how this behavior is consistent with ES5 spec. In http://www.ecma

Re: [JSMentors] Object(null)

2011-04-02 Thread Poetro
whatever k was it doesn't mind. And object is not equal to anything except itself. console.log(Object(null)); // Object console.log(null); // Object -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search

Re: [JSMentors] Problem removing event listener?

2011-03-23 Thread Poetro
that, but a different function, that has the same implementation. Just think of: var a = {}, b = {}; alert(a === b); // false -- Poetro -- 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

Re: [JSMentors] Re: Post/repo on small something to help with checking for object conformance

2011-03-22 Thread Poetro
and https://github.com/garycourt/JSV -- Poetro -- 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 unsubscribe from

Re: [JSMentors] accessing global variable in a callback

2011-03-21 Thread Poetro
about global scope? -- Poetro -- 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 unsubscribe from this group

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

2011-03-21 Thread Poetro
the kitchen sink. Like relying on if the browser is IE then it cannot do certain things, but as IE9 came out, a bunch of applications are now broken, because they think, that IE behaves in a non standard way, but now it does (YMMV). -- Poetro -- To view archived discussions from the original JSMentors

Re: [JSMentors] ES5: Object.keys and Object.getOwnPropertyNames

2011-03-01 Thread Poetro
). -- Poetro -- 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 unsubscribe from this group, send email

Re: [JSMentors] stdin and stdout

2011-02-24 Thread Poetro
, as they are 'private'. Just use the functions that are available in the documentation. -- Poetro -- 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

Re: [JSMentors] Image pre-loading

2011-02-16 Thread Poetro
. -- Poetro -- 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 unsubscribe from this group, send email

Re: [JSMentors] Image pre-loading

2011-02-16 Thread Poetro
, there wont be a high need of frameworks that abstract event handling or AJAX. I think this is one similar case. -- Poetro -- 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

Re: [JSMentors] new Number(...) use case

2011-02-04 Thread Poetro
Number(0)).toFixed(2) You can either use (0).toFixed(2) There is maybe a speed difference between the two (hard to tell which is faster), but I wont think about speed here, but then number of trasferred bytes is less for sure. -- Poetro -- To view archived discussions from the original

Re: [JSMentors] $('body') vs $(document) in Pub/Sub pattern

2011-02-03 Thread Poetro
that there would be other difference. -- Poetro -- 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 unsubscribe

Re: [JSMentors] The const keyword in JavaScript

2011-01-21 Thread Poetro
in: JavaScript 1.5, NES 6.0 (Netscape extension, C engine only) -- Poetro -- 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

Re: RE: [JSMentors] using new with Wrappers

2011-01-15 Thread Poetro
this sound right? It depends on the view of what is considered a property or method. console.log(typeof string.replace) function console.log((1.23456).toFixed(2)) 1.23 console.log(what is my.length) 10 It looks to me that primitives has methods and properties. -- Poetro -- To view archived

Re: [JSMentors] setInterval overhead

2011-01-14 Thread Poetro
2011/1/14 Peter van der Zee jsment...@qfox.nl: Certain browsers have a minimal interval at which timers can be called. For example, firefox has 10ms intervals. So timers simply can't be called faster than ten times per second. You must have meant 100 times per second. -- Poetro -- To view

Re: [JSMentors] function name property

2011-01-14 Thread Poetro
or Node.js, While IE8 prints undefined. -- Poetro -- 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

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

2011-01-14 Thread Poetro
` declarations in just turn of that check. It is totally optional. Maybe you are using a broken implementation. -- Poetro -- 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

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

2011-01-14 Thread Poetro
per function` function aaa() { var x; Date(); if (x) { aaa(); } var y; x = y; } -- Poetro -- 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

Re: [JSMentors] JS API Design - Accepting Parameters

2011-01-13 Thread Poetro
Support both. If you are hesitant, you can support both ways. Take the jQuery API for example. It supports optional arguments, and depending on the type of the arguments they behave differently. -- Poetro -- To view archived discussions from the original JSMentors Mailman list: http

Re: [JSMentors] timer for HTML5 video player/jQuery

2011-01-10 Thread Poetro
function initVideoProgress() { function formatTime(time, fragments) { var output = '', fragment; // Maximize the fragments in 3. fragments = Math.max(1, Math.min(3, fragments || 3)); // For every fragment generate output. while (fragments--) { if (output) {

Re: [JSMentors] Re: outsmarting the compiler?

2010-12-22 Thread Poetro
at the following example: var x = [0, 1, 2, 3], i; function y(a) { var l = a.length; if (a.length 10) { a[l] = l; } return a; }; for (i = 0; i x.length; i++) { y(x); } console.log(x); // Output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -- Poetro -- To view archived discussions from the original

Re: [JSMentors] Performance comparison: dom tree clone vs. creating each element

2010-12-21 Thread Poetro
, at least i haven't seen such (although i've never used MooTools either). Error: java.lang.NoSuchFieldException: getAttribute in class: nano. message: java.lang.NoSuchFieldException: getAttribute in class: nano code: 9 -- Poetro -- To view archived discussions from the original JSMentors Mailman list

Re: [JSMentors] JavaScript MVC is a good idea?

2010-12-21 Thread Poetro
(pub/sub) is a great patter to address such questions. An event can be subscribed to, and can be published. The view can subscribe to the messages, and the model could publish the message. Browsers do support pub/sub pattern, as well as server side implementations like Node.js. -- Poetro -- To view