Jquery 胡子包括模板
我是新来的胡子,我正在一个网站上工作,已经在使用它。我在这个网站的文件夹里有一套小胡子模板。它们在主html中使用Sekizai标记进行调用,如下所示:Jquery 胡子包括模板,jquery,html,mustache,Jquery,Html,Mustache,我是新来的胡子,我正在一个网站上工作,已经在使用它。我在这个网站的文件夹里有一套小胡子模板。它们在主html中使用Sekizai标记进行调用,如下所示: <html> <head>...</head> ... <body> {% block body_content %}{% endblock %} {% mustachejs "dashboard_module" %} {% mustachejs "dashboard_
<html>
<head>...</head>
...
<body>
{% block body_content %}{% endblock %}
{% mustachejs "dashboard_module" %}
{% mustachejs "dashboard_add_module" %}
{% mustachejs "dashboard_empty_module" %}
{% mustachejs "login_popup" %}
{% mustachejs "add_account_types_popup" %}
{% mustachejs "add_account_manual_popup" %}
{% mustachejs "add_account_success_popup" %}
{% mustachejs "chart_linearprogress" %}
{% mustachejs "adviser_popover" %}
{% mustachejs "add_event_popup" %}
</body>
</html>
当然,myfunc()中的内容不起作用!我该怎么做呢?找到了:
var template = Mustache.template('add_event_popup').render(null);
function my func(){
var evnt_btn = $('.add-evnt-btn');
var template;
// get mustache template
template = $( Mustache.render( 'add_event_popup' ));
evnt_btn.click(function(){
template.show();
});
}
var template = Mustache.template('add_event_popup').render(null);