def dump_js_escaped_json(obj, cls=EdxJSONEncoder):
 json_string = json.dumps(obj, ensure_ascii=True, cls=cls)
 json_string = _escape_json_for_js(json_string)
 return json_string

def dump_js_escaped_json ( obj , cls = EdxJSONEncoder ) : json_string = json . dumps ( obj , ensure_ascii = True , cls = cls ) json_string = _escape_json_for_js ( json_string ) return json_string
json dumps and escapes objects that are safe to be embedded in javascript .