Wednesday, 6 November 2013

JQuery ajax method to get content of another file

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="jquery-1.9.0.min.js"></script>
<script>
function fun1()
{
 $.ajax({
  url:"audio.html",
  success: function(data){
   $("#msg").html(data);
   }
  });
}
</script>
</head>

<body>
<input type="button" value="load" onclick="fun1()" />
<div id="msg">
</div>
</body>
</html>

0 comments:

Post a Comment