Monday, September 30, 2013

JavaScript style guides

There are various style guides available on a market for JavaScript. To name a few: For many years I was always suggesting to stick to Crockford convention, and use his book as a reference. But because people don't read books, and google style guide is much more explicite, and well defined, and available on the web with good examples. I decided to change my JavaScript style guide to google one.

Friday, September 27, 2013

Hacker News London meetup

I haven't keep a track of tech meetings I attended recently. Maybe it would be good to start doing it again:
Hacker news meetup a good one. I really enjoyed people, presentations, beer and pizza. Maybe not including the last presentation (google app engine), because it was to commercial, and nothing interesting was said. The sad part is it was at this same time as Sitecore User Group meeting, that I usually attend.

Friday, September 20, 2013

JQuery $(...).ready is not a function

This one happened to me many times. It usually means that some script override the $ variable, and after JQuery has been initialized. In other words there is a huge chance that one of a javascript libraries that you added recently overrides $. The best way to check if it's the case is to fire up following script under firebug script console.

If the result is simmilar to this:
function (a,b){return new e.fn.init(a,b,h)}

Everything is ok, this is how $ looks when JQuery is in charge of it. But often I see something else. For example a code below means that mootools is also used and it takes over $ function:
function (B, C) { if (B && B.$family && B.uid) { return B; } var A = $type(B); return ($[A]) ? $[A](B, C, this.document) : null; }

And it means that some code did something nasty with $ variable. The next thing that I do is to read libraries, disable them, and follow a typical tracing path.

Monday, September 16, 2013

What to do if there is no FireBug installed in Firefox

I noticed that many Firefox users are unaware that since version 11 firefox introduced a tool that is similar to firebug. You can trigger it by hitting:

I sometimes debug/trace an issue not from a development machine, and I don't have an access to firebug, so it is worth to remember, that Style Editor is there to help you.