Create index.html
This commit is contained in:
25
index.html
Normal file
25
index.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
launch();
|
||||||
|
|
||||||
|
function launch() {
|
||||||
|
try {
|
||||||
|
fetch("https://cdn.jsdelivr.net/gh/gn-math/gn-math.github.io@main/singlefile.html?t="+Date.now())
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(html => {
|
||||||
|
document.documentElement.innerHTML = html;
|
||||||
|
|
||||||
|
document.documentElement.querySelectorAll('script').forEach(oldScript => {
|
||||||
|
const newScript = document.createElement('script');
|
||||||
|
if (oldScript.src) {
|
||||||
|
newScript.src = oldScript.src;
|
||||||
|
} else {
|
||||||
|
newScript.textContent = oldScript.textContent;
|
||||||
|
}
|
||||||
|
document.body.appendChild(newScript);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('error:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user