0

I'm trying to use w3data.js for an all html website. The goal is to limit copy/paste from page to page by adding html includes.

In my case I've created an index.html who looks like this:

<!DOCTYPE html>
<html lang="fr">

<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>

  <script src="http://www.w3schools.com/lib/w3data.js"></script>
</head>

<body id="home">

  <div w3-include-html="header-home.html"></div>
  <!-- to call a bootstrap navbar -->

  <script>
    w3IncludeHTML();
  </script>

</body>

I followed the W3 how to: http://www.w3schools.com/howto/howto_html_include.asp but it doesn't work for me.
In my console, I have an error. My website https://minutedrone.com is secure (HTTPS), but w3schools.com is not, so I can't change the script.
It works when I go on the HTTP version of my website (www.w3schools.com don't have a HTTPS version).

What can I do to fix this issue, or is there another way to do what I want?

Please help. Thanks !!

Alexander Nied
  • 12,804
  • 4
  • 25
  • 45
  • I'm not going to lie-- I've never heard of the `w3-include-html` and I'm having a difficult time finding any documentation about it... – Alexander Nied Oct 25 '16 at 15:22
  • thanks anied _ someone suggested this methode in a topic here http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file and it work pretty well in http but the issue here is to use this in https .. – Aymen AHMED Oct 25 '16 at 15:28
  • OK, looking now, I see this is not a native attribute, but something provided by the script. I understand the issue now. – Alexander Nied Oct 25 '16 at 15:35

1 Answers1

0

You can:

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thanks @Quentin will go for the first option (hosting the JS) until i learn the methods you suggested in your post. – Aymen AHMED Oct 31 '16 at 15:38