简体   繁体   English

JQuery库中的特殊值

[英]Particular value in a JQuery library

I'm using the JQueryGantt library and looking in the source code I found as value of some <input> element, values like these (#=obj.code?obj.code:''#) . 我使用的JQueryGantt库和寻找在源代码中,我发现作为value的一些<input>元素,值等这些(#=obj.code?obj.code:''#) I haven't seen nothing like this in javascript. 我没有在javascript中看到类似的东西。 What are these? 这些是什么?

its for the JST jquery template engine, this way you can access properties of the object, in this case a "TASKROW" and renders the value, check the lines 30 to 47 to see how it is parsed and executed 对于JST jquery模板引擎,您可以通过这种方式访问​​对象的属性,在本例中为“ TASKROW”并呈现该值,请检查第30至47行以了解如何解析和执行该对象

https://github.com/robicch/jQueryGantt/blob/52bc859bab0866a45b2e233b5783ed8d7046ae4b/libs/jquery/JST/jquery.JST.js https://github.com/robicch/jQueryGantt/blob/52bc859bab0866a45b2e233b5783ed8d7046ae4b/libs/jquery/JST/jquery.JST.js

the object is defined for usuage with the templating engine 使用模板引擎定义该对象以供使用

var taskRow = $.JST.createFromTemplate(task, "TASKROW");

and in the template you see 并在模板中看到

<div class="__template__" type="TASKROW"><!--
  <tr taskId="(#=obj.id#)" class="taskEditRow (#=obj.isParent()?'isParent':''#) (#=obj.collapsed?'collapsed':''#)" level="(#=level#)">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM