I am trying to load content of a file to a division using jquery. After loading contents the page refresh automatically.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btn1").click(function(){
$("#div1").load("file.txt");
});
});
</script>
</head>
<body>
<form name='form1'>
<input id="btn1" type="submit">
</form>
<div id="div1"></div>
</body>
</html>
So the contents in division with id div1 never show up. I put break points to check whether file loads or not. It load successfully. Because of page refresh automatically the contents never displays.
Help me to fix it
type='button'..Simple!