Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
When you add HTML with append HTML, it goes to the end of the body. ¿Is there a way to load it at the beginning of the body?
in how_to by (380 points)
  

1 Answer

0 votes

No, there is not. However, <head> content will automatically be move to the head section of the output (which precedes the body).

Can you help me understand why you want something at the beginning of the body?

by (196k points)

It works in the head, but the code duplicates the content in the body and there are two close tags for </head>

in line 14:

<script type="text/javascript" defer src="assets/js/buscador.js"></script>

and in line 43

<script type="text/javascript" defer src="assets/js/buscador.js"></script>

The same with the rest of the code in the HTML appended.

It's for a finder. You can see an example here:

https://emagazines.es/caribe/

This is the new code with the duplication. As you can see it generates a double </head>

</head>
<body>
<!--[if lt IE 10]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div id="loadIndicator"><img src="assets/images/loading.gif" alt="loading..."/><span>&nbsp;</span></div>
<div id="container-wrap">
<div id="container">
<div class="page" data-name="1" data-section="" data-section-marker="" data-layout="undefined" style="width:595px;height:842px;">
<div class="page-scale-wrap mq-none mq-default" data-layout-name="undefined" style="width:595px;height:842px;">
<img src="assets/images/AdobeStock_240374286-recortada%20(1200px,%2025fps).gif" class="pageItem" alt="Created with PlotagraphPro Learn more at https: plotaverse com" style="width:637px !important;height:893px !important;left:-21px !important;top:-8px !important;" id="item3546"/>
</div>
</div>
<script type="text/javascript" defer src="assets/js/buscador.js"></script>
<!-- BUSCADOR -->
<div class="header-content">
<div id="ctn-icon-search">
<i class="fas fa-search" id="icon-search"></i>
</div>
</div>
<div id="icon-menu">
<i class="fas fa-bars"></i>
</div>
<!-- FIN BUSCADOR -->
</head>
When you add a <head> to the HTLM, you need to add a <body>, even if its empty <body></body> and everything works fine.
Please follow up with us by email, this is really specific and that will let us have a back and forth (and look at your files in depth): https://ajarproductions.com/pages/contact.php