<applet>标记后的ERB不呈现</applet>

时间:2013-06-19 04:10:19

标签: java html ruby-on-rails applet

我有一个包含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>修复了它(即程序再次渲染后的事情),但有人知道为什么吗?具体做法是:

  1. 为什么Rails在applet之后没有返回任何标记?
  2. 为什么使用<embed>有效?

1 个答案:

答案 0 :(得分:0)

这很简单。 <applet />应该是<applet></applet>Reference