Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


Hi Olivier,

Olivier Hallot píše v Út 30. 05. 2017 v 14:02 -0300:

The issue is to dynamically load the bookmark_<module>.html file in the
page. Currently the JS solution is

    $("#BottomLeft").load('bookmark_'+module+'.html');

(I tested replacing it by <iframe> or <object> but that brings other
issues. I also tested < link rel="imports" bookmark.../> but I also hit
restrictions on browsers (http://caniuse.com/#feat=imports) )

Ah yeah; but we generate the bookmark files ourselves; so the
Tafkadasoh's solution from

https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file

is perfectly usable for us:

a.html:

<html> 
  <body>
  <h1>Put here your HTML content before insertion of b.js.</h1>
      ...

  <script src="b.js"></script>

      ...

  <p>And here whatever content you want afterwards.</p>
  </body>
</html>

b.js:

document.write('\
\
    <h1>Add your HTML code here</h1>\
\
     <p>Notice however, that you have to escape LF's with a '\', just like\
        demonstrated in this code listing.\
    </p>\
\
');

:-)

[And we even can even have a 'smarter' b.js - list of links + tests, and
generate the resulting html in the JS.]

All the best,
Kendy


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.