Loading the result of a PHP script into a div from a link with JQuery
===

I have been trying to load the content of a link to a div element without reloading the page. I found this solution 'http://wecodesign.com/demos/stackoverflow-7071545.htm' and have tried it but I couldn't get it to work. 

What I am doing is exactly the same, but for some reason it doesn't work.

This is the Jquery part:

    <script type="text/javascript">

		function updateContainer( url ){
		    dynamicCon = '#mainContent';    
		    ObjTag = $( dynamicCon );
		    ObjTag.load( url );
		}
		$( document ).ready( function() {
		    $( 'a[rel="dynamicLoad"]' ).bind( "click", function( event ) {
		        url = $( this ).attr( 'href' );
		        updateContainer( url );
		        event.preventDefault();
		        event.stopPropagation();
	        });
		});
	</script>

And this is the PHP bit I use to output the HTML:

    echo '<li><a href = "/getPost.php?q='. $row['id'] .' " rel="dynamicLoad" >'. $row['title'] .'</a> </li> <br>';

But this sends me to the link instead of loading it into the div. The div I want the content to load into is called "mainContent". Now, I can't say I know JQuery but everything looks OK to me but obviously I am missing something.

Thank you