I am using simple ajax functionality using with mootool for display loading image. I have added loading image on onRequest but not working. Is there any wrong in my code. I am getting Uncaught SyntaxError: Unexpected token }
after }).send();
My Code:
$('nextButtonForm2').addEvent('click', function(e) {
e.stop();
var url = 'index.php?option=com_property&view=property&task=advertisementBox&format=raw';
var x = new Request({
url: url,
method: 'post',
onSuccess: function(responseText) {
document.getElementById('advertisement_image').innerHTML = responseText;
},
onRequest: function() {
$('advertisement_image').set('html', '<div><img src='http:
//www.example.com/template/xxx/xx/images/loding.gif'></div>');
}
}).send();
});
Any ideas or suggestions? Thanks.