简体   繁体   中英

Why are my script tags rendered outside my body tag?

This is my nhaml code

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

The resulting HTML renders the last tags as such:

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

</html>

As _scripts is still at the indentation level of %body +1, why does it close body down before rendering _scripts?

Does it work if you move the scripts above the partial? If so, then the partial may be to blame.

   %h1 = "hello world"
    _scripts
    _

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM