2013-06-19 63 views
-1

我有一個頁面,其中包含一個Java小程序。該小程序位於_program.html.erb部分。這裏的簡化ERB:ERB後<applet>標記不呈現

<%= 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 %>" /> 

小程序渲染,但它呈現什麼之後,包括該局及HTML後和頁腳諧音。小應用程序標籤之前的HTML在小應用程序標籤之後正確關閉。我發現使用<embed>而不是<applet>修復它(即在程序再次渲染後的東西),但有人知道爲什麼嗎?具體來說:

  1. 爲什麼Rails在applet之後沒有返回任何標記?
  2. 爲什麼使用<embed>有效?
+0

它不在HTML源代碼中嗎?或者你的瀏覽器沒有渲染它?兩件完全不同的事情。 –

+0

@PhilipHallstrom正如我在上面的HTML註釋中提到的,「它們不在HTML源代碼中」 –

+0

所示的'HTML'完全無效。使用[驗證服務](http://validator.w3.org/)在輸出到達瀏覽器時檢查輸出。部署JWS應用程序的最佳方式。或applet將使用[部署工具包腳本](http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html)。 –

回答

0

這已經很簡單了。 <applet />應該是<applet></applet>Reference