Make javascript code work with Minimal Download Strategy Part 1

By Anatoly Mironov