1
Fork 0
mirror of https://github.com/Steffo99/referer.steffo.eu.git synced 2024-11-24 12:04:21 +00:00

Add window.open test

This commit is contained in:
Steffo 2019-08-05 13:39:04 +02:00
parent fe75fe2174
commit bf4c9a4b97
3 changed files with 21 additions and 0 deletions

5
app.py
View file

@ -23,6 +23,11 @@ def location_replace_page():
return f.render_template("locationreplace.html") return f.render_template("locationreplace.html")
@app.route("/window/open")
def window_open_page():
return f.render_template("windowopen.html")
@app.route('/referer') @app.route('/referer')
def referer_page(): def referer_page():
referer = f.request.headers.get("Referer") referer = f.request.headers.get("Referer")

View file

@ -12,6 +12,7 @@
<li><a href="{{ url_for("link_page") }}">Simple link</a></li> <li><a href="{{ url_for("link_page") }}">Simple link</a></li>
<li><a href="{{ url_for("location_href_page") }}">location.href</a></li> <li><a href="{{ url_for("location_href_page") }}">location.href</a></li>
<li><a href="{{ url_for("location_replace_page") }}">location.replace()</a></li> <li><a href="{{ url_for("location_replace_page") }}">location.replace()</a></li>
<li><b><a href="{{ url_for("window_open_page") }}">window.open()</a></b></li>
</ul> </ul>
</body> </body>
</html> </html>

15
templates/windowopen.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>location.href</title>
<script>
function move() {
window.open("/referer")
}
</script>
</head>
<body>
<button onclick="move()">Click on me!</button>
</body>
</html>