json_encode > esc_js Thanks @danielck