<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.onhtml.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.onhtml').bind('click',function(){
$('#content').onHtml(
$(this).attr('data-onhtml'),
{ part1: "Somedata", part2: "Some other data" }
);
});
});
</script>
</head>
<body>
<div>
<button type="button" class="onhtml" data-onhtml="php/data.php">Load content</button>
</div>
<div id="content">Default content</div>
</body>
</html>
|