Saturday, 14 September 2013

Display content of a html page in a div

Display content of a html page in a div

I have an index.html page:
<body>
<ul>
<li><a id="page" href="#">About</a></li>
</ul>
<div id="show">
</div>
</body>
a jQuery:
<script type="text/javascript">
$(document).ready(function(){
$("#page").click(function(){
$('#show').load('test.html');
});
});
</script>
What I need is to display content from test.html in #show div, but above
code doesn't work.



So my question is: what did I do wrong?
PS: I'm using jQuery 1.9.1 library from link <script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
type="text/javascript"></script> and it works with other jQuery scripts.

No comments:

Post a Comment