I'm trying to load a HTML file into a div section, but the load() method doesn't seem to work as when I click the link, the html file opens in a new tab instead of loading into the div tag.
The script:
<script type="text/javascript">
$(document).ready(function(){
$('a').click(function(){
$('#main-content').load($(this).attr("href"));
return false;
});
});
</script>
The 'a' tag:
<li><a href="about.html">ABOUT</a></li>
Where I want my html file to be loaded:
<div class="col-sm-9 blog-main" id="main-content">
...
</div>
How do I make the load() method work?
I'm using Chrome on Windows.