Still new to jQuery, need help on following:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery demo</title>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.nav-link').click( function() {
var href = $(this).attr('href');
$('#content').load( href, function() {
alert("Yeahhhh !");
});
return false; // don't actually follow the link
});
});
</script>
<div class="menu">
<ul>
<li><a href="http://www.google.com.my/" class="nav-link"> Yeah 1 </a></li>
<li><a href="C:\Testing\Yeah1.html" class="nav-link"> Yeah 2 </a></li>
</ul>
</div>
<div id="content">
... Initial Content...
</div>
</body>
</html>
I created this HTML file called testing.html and have another simple HTML file called yeah1.html for testing purpose. Before putting the jQuery codes, the link could be directed to yeah1.html.
However, after putting the jQuery codes, the $('#content').load( href); should be able to load the content in its DIV and I've even got the message alert of "Yeahhhh !"...but, still the content is not loaded.