client/cree-client.js
function loadPage(url) {
		$("#container").load(url+" #container > *", function(response, status, xhr){
			$('html,body').scrollTop(0); // Scroll to the top when loading new page.
			if(status == "error"){
				$("#container").prepend('<p class="alert alert-danger" role="alert"><strong>'+msgError+'</strong> '+xhr.status+' '+xhr.statusText+' <small>'+url+'</small></p>');
			} else if(status == "success"){
				cloak.message('loaded', url); // Respond back to server with 'loaded' message
			}
		});	
		
	}
function loadPage(url) {
		$("#container").load(url+" #container > *", function(response, status, xhr){
			$('html,body').scrollTop(0); // Scroll to the top when loading new page.
			if(status == "error"){
				$("#container").prepend('<p class="alert alert-danger" role="alert"><strong>'+msgError+'</strong> '+xhr.status+' '+xhr.statusText+' <small>'+url+'</small></p>');
			} else if(status == "success"){
				cloak.message('loaded', url); // Respond back to server with 'loaded' message
			}
		});	
		
	}
function loadPage ( url ) { $ ( "#container" ) . load ( url + " #container > *" , function ( response , status , xhr ) { $ ( 'html,body' ) . scrollTop ( 0 ) ; // Scroll to the top when loading new page. if ( status == "error" ) { $ ( "#container" ) . prepend ( '<p class="alert alert-danger" role="alert"><strong>' + msgError + '</strong> ' + xhr . status + ' ' + xhr . statusText + ' <small>' + url + '</small></p>' ) ; } else if ( status == "success" ) { cloak . message ( 'loaded' , url ) ; // Respond back to server with 'loaded' message } } ) ; }
Using AJAX, load the url that was received from the server through a 'load' message.
Using AJAX load the url that was received from the server through a load message .