Home >php教程 >php手册 >jquery tmpl 模板

jquery tmpl 模板

WBOY
WBOYOriginal
2016-06-06 20:00:461222browse

jQuery.tmpl.js 网址如下: http://api.jquery.com/category/plugins/templates/ 实例 html head titlejquery tmpl/title script type=text/javascript src=jquery-1.7.2.js /script script type=text/javascript src=jquery.tmpl.js /script /head body ul

jQuery.tmpl.js


网址如下:

http://api.jquery.com/category/plugins/templates/


实例



    jquery tmpl
   
   


   


       

   

//数据
        var
movies = [
            { Name:"red", rel:"1998"},
            { Name:"wide", rel:"1994"},
            { Name:"blue", rel:"1997"}
        ];

//模板结构
        var
markup = "

  • ${Name} (${rel})
  • ";

    //生成模板
            $.template("movieTemplate",
    markup);

    //模板绑定数据
            $.tmpl("movieTemplate",
    movies)

    .appendTo("#list");
       


    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn