9
I am developing an HTML page for mobile and I have the following question: is it possible to load one page inside another?
For example:
pagina.html
:
<div class="container22">
<div id="sidebar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Explore</a></li>
<li><a href="#">Users</a></li>
<li><a href="#">Sign Out</a></li>
</ul>
</div>
<div class="list bar bar-header">
<a class="button button-icon icon-right ion-close" onclick="exitFromApp();"></a>
<h1 class="title">Lwart</h1>
<a class="button button-icon icon-right ion-gear-b" href="#" data-toggle=".container22" id="sidebar-toggle"></a>
</div>
In the code above I am first loading my list of page options, which so far is just an example.
It has a CSS and a JS behind it, which makes this list load as a side menu. However, I believe that this is not the case, but rather that after that I want to add the loading of external pages.
For example: the user clicks on the element home
from my list, it must load the page home.html
down, in a div.
I took a look but I’m not sure if this is done with Ajax, right? I’m a little lost and since I don’t know much of Ajax, I decided to see if someone here gives me a light.
It wouldn’t be simpler (and faster) to put all the contents of these pages inside the
divs
and simply change them with jQuery or Javascript? Something like code of this answer Soen (as the fiddle link of this reply was not working, I created one with the code posted: http://jsfiddle.net/gustavox/tcrkcbt8/)– gustavox
Here is another example: http://jsfiddle.net/TLBvx/1/
– gustavox
can even be faster put as I increase the page will become a big mess. So I wanted to keep things separate. And I’m already having a hard time with six separate pages
– user24203