View Single Post
Old 10-03-2012, 05:24 PM   PM User | #4
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
Hi,

First, take the onclick handlers out of your HTML. It's bad practice.

Update your links to look like:

Code:
<a class="load_inline" href="../report_data_fe_nldm_completeness/DB_existence_PVT_report.html"><h3><u>DB NLDM MCMM</u></h3></a>
(ie: give them a class of "load_inline", and put the file that you want loaded in the href attribute).

Now put this in your document <head>

Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$('.load_inline').on('click', function(event){
		event.preventDefault();
		$('#content').load( $(this).attr('href'), function(responseText, textStatus, XMLHttpRequest){
			if ('success' != textStatus) {
				$("#content").html("Sorry, an error occurred");
			}
		});
	});
});
</script>
Spudhead is offline   Reply With Quote