def _escape_json_for_js(json_dumps_string):
    """
    Escape output of JSON dumps that is safe to be embedded in a <SCRIPT> tag.

    This implementation is based on escaping performed in
    simplejson.JSONEncoderForHTML.

    Arguments:
        json_dumps_string (string): A JSON string to be escaped.

            This must be the output of json.dumps to ensure:
            1. The string contains valid JSON, and
            2. That non-ascii characters are properly escaped

    Returns:
        (string) Escaped JSON that is safe to be embedded in HTML.

    """
    json_dumps_string = json_dumps_string.replace("&", "\\u0026")
    json_dumps_string = json_dumps_string.replace(">", "\\u003e")
    json_dumps_string = json_dumps_string.replace("<", "\\u003c")
    return json_dumps_string