Defer javascript execution using data