Here is the code I am using to load an external file inside a div:
EXAMPLE
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.reveal').on('click', function(e){
e.preventDefault();
var link = $(this).attr('href');
$('.page').load(link);
});
});
</script>
<p class="flaticon-right127"><a class="reveal" href="car.php">Mobile Phones</a></p>
<p class="flaticon-right127"><a class="reveal" href="tablet.html">Tablets</a></p>
<p class="flaticon-right127"><a class="reveal" href="accessories.html">Mobile Accessories</a></p>
<div class="page"></div>
When clicking on a link, an external page is opened, but I would like to load the external file in the same page within a div.
car.php
<html>
<body>
external page
</body>
</html>