I am trying to add a nav page without body and html tag to a html page using JavaScript(j Query). but its not working . i tried changing the browser and used firefox,Crome as well as edge. but it did not work.
this is code structure.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<title>demo</title>
</head>
<body>
<div id="content"></div>
<script>
$(document).ready(function() {
$('#content').load("nav.html");
});
</script>
</body>
</html>
i also tried this as well.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<title>dem0</title>
<script>
$(document).ready(function() {
$('#content').load("nav.html");
});
</script>
</head>
<body>
<div id="content"></div>
</body>
</html>
this is my nav.html file
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quod tenetur beatae ex assumenda,
non odit praesentium? Animi commodi, est veritatis quis perferendis at blanditiis? Nesciunt
inventore aperiam odit sint est maiores quo esse facilis accusamus alias</p>
where am i going wrong?
nav.htmlis correct? As Pointy said, are there any issues you can see in dev tools of the browser?