-
-
Save st98/f6094dfc8102184beba8 to your computer and use it in GitHub Desktop.
DOMContentLoaded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return ''' | |
<!doctype html> | |
<body> | |
<head> | |
<title>DOMContentLoaded</title> | |
</head> | |
<body> | |
<h1>DOMContentLoaded</h1> | |
<img src="a.png"> | |
<script> | |
window.addEventListener('load', function () { console.log('<load>'); }); | |
window.addEventListener('DOMContentLoaded', function () { console.log('<DOMContentLoaded>'); }); | |
</script> | |
</body> | |
</body> | |
''' | |
@app.route('/a.png') | |
def a(): | |
time.sleep(5) | |
return '' | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment