【发布时间】:2013-12-29 18:38:31
【问题描述】:
我在 CGI 程序中有这个 HTML 代码:
0 @@ process.html.ep
1 <% if ($errormsgs) { %>
2 <% for my $e (@$errormsgs){ %>
3 <%=$e%>
4 <br>
5 <% } %>
6 <a href="javascript:history.back();">Go back to fix the form</a><br>
7 <% } %>
8 <% if ($successmsg) { %>
9 <% for my $s (@$successmsg) { %>
10 <%=$s %>
11 <% } %>
12 <a href="<%= url_for('/') %>">Send another?</a><br>
13 <% } %>
所以当1 行为真时,12 行不打印,这就是我想要的,但是当1 行为假时,6 行打印,但这不应该发生,因为我用if 括号括起来,所以我想要的是当$errormsgs 为假时,不应该显示<a href="javascript:history.back();">Go back to fix the form</a><br>。
有什么想法吗?
【问题讨论】:
标签: javascript html perl cgi mojolicious