zoukankan      html  css  js  c++  java
  • -_-#【Backbone】View

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <link rel="stylesheet" href="../../app-min.css">
        <script src="../../jquery/jquery-1.10.2.js"></script>
        <script src="../underscore.js"></script>
        <script src="../backbone.js"></script>
        <script>
            var SearchView = Backbone.View.extend({
                initialize: function() {
                    console.log('init a SearchView')
                },
                render: function(context) {
                    var template = _.template($('#search_template').html(), context)
                    $(this.el).html(template)
                },
                events: {
                    'click input[type=button]': 'doSearch'
                },
                doSearch: function(event) {
                    console.log('search for ' + $('#search_input').val())
                }
            })
            var searchView = new SearchView({el: $('#search_container')})
            searchView.render({search_label: '搜索渲染'})
        </script>
        <article class="content">
            <pre>var SearchView = Backbone.View.extend({
        initialize: function() {
            console.log('init a SearchView')
        },
        render: function(context) {
            var template = _.template($('#search_template').html(), context)
            $(this.el).html(template)
        },
        events: {
            'click input[type=button]': 'doSearch'
        },
        doSearch: function(event) {
            console.log('search for ' + $('#search_input').val())
        }
    })
    var searchView = new SearchView({el: $('#search_container')})
    searchView.render({search_label: '搜索渲染'})</pre>
        </article>
    </body>
    </html>
  • 相关阅读:
    tar (child): gzip: Cannot exec: No such file or directory
    通过应用数字格式来修复文本格式的数字
    Logback
    Transport
    nginx note
    docker note
    k8s note
    spring boot properties
    Windows 和 Linux 的文件名
    安装配置ubuntu的web项目(新)
  • 原文地址:https://www.cnblogs.com/jzm17173/p/4171836.html
Copyright © 2011-2022 走看看