Cancel javascript if window.nestedMenuItems not exists.