I need some help adapting this simple script in PHP that work well to the Silverstripe MVC system.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
var refreshId = setInterval(function() {
jQuery('#load').fadeOut("fast", function () {
jQuery(this).load("reload.php", function () {
jQuery(this).fadeIn("fast");
});
});
}, 1000 * 15);
});
</script>
My main problem is how to load a part code to a template and not a full page content. In this example, reload.php is only a part of code. But in Silverstripe, I need render a part of code to a template and retreive it from a controller.
Is there someone know how to do that? Thank you!