ddrayne + javascript   187

CSS3 PIE: CSS3 decorations for IE
This quick demo shows just a few of the CSS3 properties PIE can render. Use the controls to adjust the CSS3 applied to the box. Load this page in IE to see that it is rendered properly!
css3  javascript  ie6  ie 
february 2012 by ddrayne
Explain JavaScript's encapsulated anonymous function syntax - Stack Overflow
3 Answersactiveoldestvotes
up vote
55
down vote
accepted
It doesn't work because it is being parsed as a FunctionDeclaration, and the name identifier of function declarations is a mandatory.

When you surround it with parentheses it is evaluated as a FunctionExpression, and function expressions can be named or not.
javascript  oop 
february 2012 by ddrayne
Adequately Good - Writing Testable JavaScript - by Ben Cherry
ostic of the environment (DOM, browser, etc). For my purposes, I would have probably written a url redirector function that i pass both the URL to *and* the controller to do it on (in this case, the window.location object). As such, instead of relying on the single "singleton" global (window.location), my unit tests can pass in a mocked window.location object and assert that it's manipulated correctly.

The only thing I'd really take issue with is the idea of not creating private methods in closures. I understand the thought behind it, but I think it's off base, and here's why:

If I'm unit testing a built-in native (I know, why do that!?), I don't care how it works internally... I assume it works internally as expected. I write tests to test it as a single indivisable unit. In other words, does a RegExp object with a known regex and a known string produce a known output. If the browser changes how it does that internally, I don't care.

I like to think of testing modules that way too. I can test the public API of a module all day long, but asking me to be able to expose all my internal-only methods for testing is a request that seems unruly. Imagine some other language like Java that was more formal... would the advice there be "make everything public so it's all testable"? I doubt it.

The formalism of hiding private stuff can be abused, but properly used it has a good place in JS in my opinion. We shouldn't discourage its use by saying it's untestable. We should show ways that privates can be useful (and the public API that uses them still feasibly testable) and contrast that wi
javascript  programming  testing 
january 2012 by ddrayne
HTML5 Canvas & Processing JS
anvas before and had to start from scratch. I went through the pain of learning every aspect of adding text, drawing shapes, importing image, etc... before I found the amazing canvas framework Processing.JS

For those who don't quite fully grasp what HTML5 Canvas check out the W3Schools entry for the element before reading any further, but it's basically an element that defines graphics.
canvas  javascript 
january 2012 by ddrayne
HTML5 Rocks - The Basics of Web Workers
self.addEventListener('message', function(e) {
self.postMessage(e.data);
}, false);
web-workers  html5  javascript 
january 2012 by ddrayne
Code Org, Take 2: Structuring JavaScript Applications - rmurphey
els, views (for view controllers and templates), and controllers (for application-level controllers). Those directories — especially the views directory — may contain subdirectories, for instance if there’s more than one view for a certain type of data
javascript  mvc  structure 
january 2012 by ddrayne
Web application development workflow with Node.js « Le Gelblog
UI Driven development has the nice advantage to not let you develop unuseful resources but it does not let you think as good as possible the way to develop your backend. So you will probably need some refactoring. Fortunately, with your tests refactoring will be easier and safer. Moreover patterns you see when you develop UI first push you to think about refactoring that match better to your needs.
git  javascript  tutorial  web 
january 2012 by ddrayne
No Alert in WinJS! Use console or MessageDialog instead | Adam Kinney – Design Developer
Additionally while running the app in Blend I noticed that there was no JavaScript console there.  Let’s hope one is added before Blend 5 ships, as that will make debugging across the tools simpler.
winjs  windows8  metro-ui  javascript 
december 2011 by ddrayne
« earlier      

related tags

3d  accessibility  activerecord  air  ajax  algorithms  animation  api  app  article  autocomplete  backb  backbon  backbone.js  beginner  blog  book  books  box2djs  browser  browsers  canvas  charts  cheatsheet  closures  code  coffeescript  css  css3  debug  debugging  design  development  django  documentation  drawing  dropdown  ecmascript  education  ember.js  events  fade  firebug  flash  forms  framework  free  gallery  game  game-dev  geo  geocode  geocoding  git  goo  goodstead  google  googlemaps  graphics  hack  howto  html  html5  ie  ie6  images  indexeddb  inheritance  inspiration  interface  iphone  javascript  jq  jquery  jquery-plugin  js  jsdoc  kwicks  learning  library  lightbox  list  mac  maps  menu  metro-ui  module  mootools  mvc  navigation  node  node.js  oop  optimization  pattern  patterns  performance  php  plugin  plugins  postcode  postmessage  presentation  programmers  programming  prototype  quiz  raphaeljs  redis  reference  rounded  rounded-corners  scope  scriptaculous  scroll  search  selector  settimeout  sifr  slider  slideshow  smashingmagazine  snippets  structure  styleswitcher  tables  tags  testing  timers  tips  tools  tooltip  tooltips  toread  towatch  tree  tutorial  tutorials  typography  ui  uk  unobtrusive  validation  video  web  web-workers  webdesign  webdev  webdevelopment  webgl  windows8  winjs  zoom 

Copy this bookmark:



description:


tags: