NextIndexPrevious

AJAX Example

2. 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>

Output :





Father of PHP

Rasmus Lerdorf

Rasmus Lerdorf

Born: November 22, 1968, Greenland