diff --git a/IPython/core/display.py b/IPython/core/display.py index 41d9378..ca5c3aa 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -852,18 +852,25 @@ class JSON(DisplayObject): def _repr_json_(self): return self._data_and_metadata() -_css_t = """$("head").append($("").attr({ - rel: "stylesheet", - type: "text/css", - href: "%s" -})); +_css_t = """var link = document.createElement("link"); + link.ref = "stylesheet"; + link.type = "text/css"; + link.href = "%s"; + document.head.appendChild(link); """ -_lib_t1 = """$.getScript("%s", function () { -""" -_lib_t2 = """}); +_lib_t1 = """new Promise(function(resolve, reject) { + var script = document.createElement("script"); + script.onload = resolve; + script.onerror = reject; + script.src = "%s"; + document.head.appendChild(script); +}).then(() => { """ +_lib_t2 = """ +});""" + class GeoJSON(JSON): """GeoJSON expects JSON-able dict