-
December 3rd, 2020, 10:23 PM
#1
How to load html page into the main page ?
Suppose I have 2 files: Main.html and Home.html, in Main.html page there is html code with the following menu:
Code:
<div class="container">
<div id="menu">
<ul class="nav justify-content-center">
<li class="nav-item"><a class="nav-link" href="Home.html">Home</a></li>
<li class="nav-item"><a class="nav-link" href="#">ServiceForum</a></li>
<li class="nav-item"><a class="nav-link" href="#">Question</a></li>
<li class="nav-item"><a class="nav-link" href="#">Forum</a></li>
<li class="nav-item"><a class="nav-link" href="#">Contac</a></li>
</ul>
</div>
</div>
When I click on "Home" from the menu, the Home.html is opened but not in the green area of the Main.html page, so when I click on "Home" from the menu, how do I edit the above code? In addition, when Home loaded by default is also loaded in the green area, how is the above code written? You see the attached photo file: http://www.mediafire.com/view/gl9wr7...WebEn.jpg/file
-
June 30th, 2021, 03:21 AM
#2
Re: How to load html page into the main page ?
You can use jQuery
HTML Code:
<html>
<head>
<script src="jquery.js"></script>
<script>
$(function(){
$("#divId").load("b.html");
});
</script>
</head>
<body>
<div id="divId" style="display:none;"></div>
</body>
</html>
Last edited by 2kaud; June 30th, 2021 at 05:17 AM.
Reason: Removed advertising link
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|