Category Javascript

How third party software can affect your site: AVG Antivirus and avg_ls_dom.js

Posted on July 20, 2011

Alberto Gragera Frontend Framework Tech Lead
Sergio Cinos Frontend Senior Engineer

Rule of thumb: your Javascript code might not be the only one executing in your website. Browser extensions and plugins as well as security software might be running their own javascript code before yours and thus, they can potentially break your site. Sadly, that was happening to some of our users with AVG antivirus - the site didn’t work at all for them.

Functions and execution contexts in JavaScript

Posted on February 24, 2011

Sergio Cinos Senior Architecture Engineer

Functions are the main building block of JavaScript. Functions define the behaviour of things like closures, ‘this’, global variables vs. local variables... Understanding the functions is the first step to truly understand how JavaScript works.

Top 13 JavaScript Mistakes

Posted on October 13, 2010

Prem Gurbani Frontend Architect
Sergio Cinos Architecture Engineer

Recently we've defined a list of most common Javascript mistakes that developers make. These cover a wide variety of topics and I'm sure you will find among them at least one that you've committed yourself. We describe the theory behind each of the problems/bad practices and show concrete solution(s).

Do you think we're missing something obvious? Leave a comment and let us know about it.

Saving Application State in History (II)

Posted on June 23, 2010

Sergio Cinos Architecture Engineer

In the previous article, we discussed how to keep our application state saved in the History, so when the user goes back to a visited page, we can load and display the state the application was in. In most browsers, you can use document.location.hash="#your-state-encoded-as-string" and everything works ok. However, in Internet Explorer 6 and Interner Explorer 7 (IE) this doesn't work. You need to use an IFRAME to save application state in their URL. As we previously saw, in IE, you need to perform a new request if you want to save state in history. You can 'fake' that request using the technique displayed in the previous article, but it doesn't work if you are using 'document.location' to enable cross-domain access (i.e.: iframes from different subdomains).