Use wp_validate_redirect() instead of esc_js(), as the latter encodes the variables, which some browsers sort of poo-poo on. See #1547.