Blog Archives

The way I like to write modular code in javascript

var MyModule = (function(module) { var _privateMethod = function() { alert(‘I am private method.’); } module = { ‘init’: function(opt) { alert(‘Hello ‘+opt['subject']+’!'); } } module.Sub = { ‘init’: function() { alert(‘I am a sub module.’); _privateMethod(); } } return

Tagged with:
Posted in JS

Simple “get my location” JS snippet

Get your location with a modern browser is really simple. Open a console (firebug) and paste the following code. function showPos(position) { console.log(position); } var loc = navigator.geolocation.getCurrentPosition(showPos); Let’s have a try.  

Tagged with: ,
Posted in JS

New useful articles and resources

http://dailyjs.com/ http://shichuan.github.com/javascript-patterns/ http://xhalent.wordpress.com/2011/05/12/javascript-closures/    

Tagged with: ,
Posted in Link, News

Some useful readings

I have decided to do some project with MongoDB, NodeJS and HTML5. It will be a very interesting entertainment based startup. I would like to share my personal readings. Here comes: HTML5 interactive demos http://html5demos.com/ HTML5 data-* http://ejohn.org/blog/html-5-data-attributes/ HTML5 reading

Tagged with: , ,
Posted in News, Post

Nice JS framework for games I will try…

Nice JS framework for games… I will try it maybe on the Facebook. http://craftyjs.com/

Tagged with: , ,
Posted in Link

http www bennadel com blog 1482 A Graphical…

http://www.bennadel.com/blog/1482-A-Graphical-Explanation-Of-Javascript-Closures-In-A-jQuery-Context.htm

Tagged with: ,
Posted in Link