簡體   English   中英

為什么我的腳本標簽顯示在我的身體標簽之外?

[英]Why are my script tags rendered outside my body tag?

這是我的nhaml代碼

^ var title=""
!!! XML
!!! Strict
%html{xmlns="http://www.w3.org/1999/xhtml"}
  %head
    %title
      Nhaml Master #{title}
      _styles
    %body
  .page      
        %h1 = "hello world"
        _
        _scripts

生成的HTML會這樣渲染最后一個標簽:

    </div>
  </body>
        <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript">
        </script>

</html>

由於_scripts仍處於%body +1的縮進級別,為什么在渲染_scripts之前關閉body?

如果將腳本移到部分腳本上方,是否可以正常工作? 如果是這樣,那么可能是部分原因。

   %h1 = "hello world"
    _scripts
    _

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM