I'm working on an HTML page (a template) using jQuery, CSS, HTML without server-side and I have a problem when I want to do to replace a <div> with another HTML page from my computer.
On the main page i have this code:
<nav>
    <h2 class="hidden">Our navigation</h2>
    <ul>
        <li><a onclick="nextpage(1);">Home</a></li>
        <li><a onclick="nextpage(2);>Contact</a></li>
    </ul>
</nav>
<div id="pageContent">
        Hello motto
        </div>
and JavaScript block is this:
function nextpage(idd){
$.get( "pages/page1.html", function( data ) {
  $("pageContent").html(data);
});
}
When I push "Home" button then must replace content of pageContent with the HTML code from my website-s root address: ../../pages/page1.html.
I tried to implement these examples and withour any good result:
- Replace current html page with ajax response
- How to get source code of html page using jquery
- jQuery.get()
I want to replace a DIV without using Server-Side API's.
Thanks!
 
     
     
    