(scriptId)
| 29 | |
| 30 | // https://stackoverflow.com/a/26276924/11898496 |
| 31 | async function getScriptSource(scriptId) { |
| 32 | try { |
| 33 | let fileName = scriptId + ".js"; |
| 34 | let path = "/scripts/" + fileName; |
| 35 | let res = await fetch(path); |
| 36 | let source = await res.text(); |
| 37 | return source; |
| 38 | } catch (e) { |
| 39 | return "// Không lấy được source code\n// Cannot load source code"; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // https://stackoverflow.com/a/6234804/11898496 |
| 44 | function escapeHTML(unsafe_str) { |