0

I have the following structure:

  • folder1
    • index
  • folder2
    • page to load

is it possible to load the page to load in a div in the index page, using DIV.load()? i've tried all possible path and it doesn't work. (../folder2/page, ./, /, ..)

it's a completely different question: Dynamically load Web Components / HTML Imports?

Community
  • 1
  • 1
Federico Pessina
  • 199
  • 1
  • 4
  • 15

2 Answers2

1

try like :

$('#id_of_your div').load( "../folder2/test.html");

you can also load only a part from page to load like :

$('#id_of_your div').load( "../folder2/test.html #container");

link of documentation : http://api.jquery.com/load/

verify also if jquery is correctly loaded, and if any bug is logged in the console.


Try also another thing just to be sure that server doesn't block links with "../" :

change the structure of your code like :

* forder project
     - index
     - sub folder
          -page to load 1
          -page to load 2
Mimouni
  • 3,564
  • 3
  • 28
  • 37
0

I think, your directory index from folder1 then, it is not accessible, if you are using virtualhost or something like that, may be you can move your directory 'folder2' in 'folder1', i am not expert but it seems like that.

Hope this help!!