0

ejs模板有没有办法在另一个函数中调用一个函数?例如,我正在尝试这样做:

<% function graph(graph) { %>
        <a href="<%= graph.href %>"><%= graph.description %></a>
<% } %>


<% function point(point) { %>

    <Placemark id="<%= point.id %>">
        <description>
        <%= point.Apibudinimas %> <%= point.IP %>
        <![CDATA[

        <% graphs.map(graph) %>

        ]]>
        </description>
    </Placemark>

<% } %>

但它说图表是未定义的......

4

1 回答 1

0

您的代码是说“图形”(带有“s”)是未定义的,而不是“图形”,对吗?你在哪里定义图形数组?否则,代码看起来不错。

于 2013-03-07T20:11:03.557 回答