Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,13 @@ load_js="""src='https://cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js'
|
|
6 |
|
7 |
game_js="""
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
async () => {
|
10 |
// set testFn() function on globalThis, so you html onlclick can access it
|
11 |
globalThis.testFn = () => {
|
@@ -221,6 +228,6 @@ with gr.Blocks() as app:
|
|
221 |
</body>
|
222 |
</html>""")
|
223 |
|
224 |
-
app.load(None,None,None,_js=load_js)
|
225 |
app.load(None,None,None,_js=game_js)
|
226 |
app.launch()
|
|
|
6 |
|
7 |
game_js="""
|
8 |
|
9 |
+
|
10 |
+
const script = document.createElement("script");
|
11 |
+
script.onload = () => console.log("module loaded") ;
|
12 |
+
script.type="module";
|
13 |
+
script.src = "https://cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js";
|
14 |
+
document.head.appendChild(script)
|
15 |
+
|
16 |
async () => {
|
17 |
// set testFn() function on globalThis, so you html onlclick can access it
|
18 |
globalThis.testFn = () => {
|
|
|
228 |
</body>
|
229 |
</html>""")
|
230 |
|
231 |
+
#app.load(None,None,None,_js=load_js)
|
232 |
app.load(None,None,None,_js=game_js)
|
233 |
app.launch()
|