加载静态文件,父模板的继承和扩展

<script>
    document.write(Date())
</script>
<nav>
 <a href="{{ url_for('test') }}">首页</a>
 <input type="text" ></input>
 <button type="submit">搜索</button>
 <a href="{{ url_for('denglu') }}">登录</a>
 <a href="{{ url_for('zhuce') }}">注册</a>
</nav>
<p align="right"><img id="myOnOff" onclick="mySwitch()" src="http://www.runoob.com/images/pic_bulbon.gif" width="40px"></p>



<body id="myBody">



{% block denglubody %}{% endblock %}
{% block zhucebody %}{% endblock %}
</body>



</html>
{% extends 'test.html'%}
{% block denglutitle %}欢迎你,请先登陆!{% endblock %}



{% block dengluhead %}


    <script  src="../static/js/wang1.js"></script>
    <link rel="stylesheet"  type="text/css"  href="../static/css/zhuce.css">
{% endblock %}
{% block denglubody %}

<div class="div" id="container">
    <div id="header" >
        <h2 class="h">登陆</h2>
    </div>
    <div id="content">
            <p class="p">账号:
                <input id="uname" type="text" placeholder="请输入用户名">
            </p>
            <p class="p">密码:
                <input id="upass" type="password" >
            </p>
            <div id="error_box"><br>
            </div>
            <button  onclick="register()">登陆</button>
            &nbsp&nbsp&nbsp
            <input type="button" name="regist" value="注册">
    </div>
    <div>
        <i>版权信息@</i>
    </div>
</div>
{% endblock %}
{% extends 'test.html'%}
{% block zhucetitle %}注册界面{% endblock %}
{% block zhucehead %}

    <meta charset="UTF-8">
    <title>注册界面</title>
    <script src="../static/js/wang.js"></script>
    <link rel="stylesheet" type="text/css" href="../static/css/zhuce.css">
{% endblock %}
{% block zhucebody %}

<div class="div" id="container">
    <div id="header" >
        <h2 class="h">注册</h2>
    </div>
    <div id="content">
            <p class="p">账号:
                <input id="uname" type="text" placeholder="请输入用户名">
            </p>
            <p class="p">密码:
                <input id="upass" type="password" >
            </p>
            <p class="p">再次输入密码:
                <input id="upass2" type="password" >
            </p>
            <div id="error_box"><br>
            </div>
    </div>
    <div>
        <button  onclick="fnLogin()">注册</button>
    </div>
    </div>
    <div>
        <i>版权信息@</i>
    </div>


{% endblock %}

 

posted @ 2017-11-05 19:06  007王俊祺  阅读(169)  评论(0编辑  收藏  举报