首頁  >  文章  >  php教程  >  jquery tmpl 模板

jquery tmpl 模板

WBOY
WBOY原創
2016-06-06 20:00:461164瀏覽

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");
       


    陳述:
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn