首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > JavaScript > Django的模板在JavaScript一样

Django的模板在JavaScript一样

  • 资源大小:5.00 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: javascript django 模板 一样

资 源 简 介

This script extends the String.prototype object with a render method that permits rendering objects using the given string as template in a Django-like style. "{% for person in list|dicsort:name %}#{{forloop.counter}} {{ person.name|capfirst }}{% endfor %}".render({list:[{"name":"Cesar","firstname":"Jules"},{"name":"Mouse","firstname":"Mickey"}]}) Requires the XRegExp script that enhance the regular expressions. Variables Variables token can be written as {{ person.name }} Filters can be applied {{ person.name|capfirst }} Controls for, adding a forloop.counter in the context if, Loop controls are written in the form {% For person in list %}
  • {{ pers
  • VIP VIP
    0.179141s