我有一个包含Java applet的页面。小程序位于_program.html.erb
部分。这是简化的ERB:
<%= render "program" %>
<div class="buttons" style="text-align:center; margin-top: 20px">
BUTTONS <!--this doesn't render, but it renders if I remove the applet tag in _program, below. It's not that the buttons are blocked from view - they're not in the HTML source -->
</div>
这是_program.html.erb
:
<applet archive="<%= program.compiled.url %>" code="<%= program.name %>" />
applet渲染,但渲染后没有任何内容,包括它后面的ERB和HTML以及页脚部分。在applet标记之后,applet标记之前的HTML正确关闭。我发现使用<embed>
代替<applet>
修复了它(即程序再次渲染后的事情),但有人知道为什么吗?具体做法是:
<embed>
有效?