function testimonialAjax() { this.OnSuccess = function() { document.getElementById('testimonial_content').innerHTML = this.GetResponseText(); } this.GetData = function() { // Get current testimonial currentTestimonial = document.getElementById('currenttestimonial'); if (currentTestimonial) { requestParam = "?current="+currentTestimonial.getAttribute('rel'); } else { requestParam = ""; } this.InitializeRequest("GET", "http://www.mendix.com/wordpress/wp-content/plugins/mendix/php/mendix-testimonial-ajax.php"+requestParam); this.Commit(null); } this.OnLoading = function() { document.getElementById('testimonial_refresh').style.display = "none"; //document.getElementById('testimonial_loading').style.display = "block"; } this.OnLoaded = function() { //document.getElementById('testimonial_loading').style.display = "none"; document.getElementById('testimonial_refresh').style.display = "block"; } } testimonialAjax.prototype = new ajax(); function refreshTestimonial() { refresh = new testimonialAjax(); refresh.GetData(); }