<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<script src="{{ url_for('site.static', filename='jquery.js') }}"></script>
<link rel="shortcut icon" href="{{ url_for('site.static', filename='favicon.ico') }}">
<link href="{{ url_for('site.static', filename='css/styles.css') }}" rel="stylesheet" type="text/css">
<link href="{{ url_for('site.static', filename='css/roboto.css') }}" rel="stylesheet">
</head>
<body>
<div id="root">
{% block root %}
{% endblock %}
</div>
</body>
</html>
{% extends 'index.html' %}
{% block root %}
<div>
<div id="navigation">
</div>
<div id="_1content">
<p>Hello {{token}}!</p>
{% block content %}
{% endblock %}
<button id="submit" value="/logout">Log Out!</button>
</div>
<script type="text/javascript" src="{{ url_for('site.static', filename = 'a-b.js') }}"></script>
</div>
{% endblock %}
{% extends 'index.html' %}
{% block root %}
<div id="submit-container">
<div id="_1anim">
<form action="/submit" method="POST">
<input type="text" name="key">
<button id="submit" value="/">Submit</button>
</form>
</div>
</div>
<script type="text/javascript" src="{{ url_for('site.static', filename='ajax.js') }}"></script>
{% endblock %}
html{
width: 100%;
height: 100%;
}
body{
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
}
#submit-container{
text-align: center;
margin-top: 45vh;
}
#_1anim{
text-align: center;
position: relative;
width: 80vh;
background: red;
}
#navigation{
position: fixed;
background: url('assets/background.png');
padding: 7vh;
width: -webkit-fill-available;
}
#_1content{
}
input{
padding: 3vh;
border: 0px solid;
transition: 0.20s;
}
input:hover{
border-radius: 10vh;
}
function top(){
echo '<div><a>Click!</a></div>'
}
<html>
<body>
<?php top() ?>
</body>
</html>
$('#sublog').click(function(){
var $data = {};
$('#log-form').find ('input').each(function() {
$data[this.Value] = $(this).val();
});
$.ajax({
type: 'POST',
url: 'http://127.0.0.1:5000/',
data: $data,
success: function(msg){
alert('OK!');
}
});
});
<input type="text" name="login" placeholder="Ваш логин"/>
<input type="password" name="pass" placeholder="Ваш пароль"/>
<input type = 'submit' id = 'sublog'/>