Jump to content
Sign in to follow this  
OliSig

W3.js includeHTML()

Recommended Posts

Hi,

<div w3-include-html="content.html"></div>

works fine for me; so does:

<div w3-include-html="folder/content.html"></div>

but

<div w3-include-html="../folder/content.html"></div>

does not i.e. picking up a code from a parallel folder.

Please advise

OliSig

Share this post


Link to post
Share on other sites

Is this the layout of your files?

  • [THIS_DIR]
    • [THIS_PAGE]
    • content.html (first example)
    • folder
      • content.html (second example)
  • folder
    • content.html (third example)

Share this post


Link to post
Share on other sites
The structure is like this:

1: ok
http://www.abc.de/kor/home/index.html
http://www.abc.de/kor/home/content.html
 "index.html" includes: <div w3-include-html="content.html"></div> 

2: ok
http://www.abc.de/kor/home/index.html
http://www.abc.de/kor/home/folder/content.html
 "index.html" includes: <div w3-include-html="folder/content.html"></div> 

3: not working
http://www.abc.de/kor/home/index.html
http://www.abc.de/kor/folder/content.html
 "index.html" includes: <div w3-include-html="../folder/content.html"></div>

4: not working
http://www.abc.de/kor/home/index.html
http://www.abc.de/kor/content.html
 "index.html" includes: <div w3-include-html="../content.html"></div>

 

Edited by OliSig
adding one more structure

Share this post


Link to post
Share on other sites

This work fine (2 folders up and one down):

<link rel="stylesheet" href="../../css/w3.css">

Should this not work as well ? (1 folder up and one down)

<div w3-include-html="../folder/content .html"></div>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...