Extract javascript to file