Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.addEvent('domready', function() {
- var myTween = new Fx.Tween('diBG',{duration:1000});
- //We can use one Request object many times.
- var req = new Request.HTML({url:'efficiencysb.php',
- onSuccess: function(html) {
- myTween.start('opacity','0').chain(
- function(){
- $('diBG').set('text','');
- $('diBG').adopt(html);
- $('time').set('text','Last updated on');
- myTween.start('opacity','1');
- }
- );
- },
- //Our request will most likely succeed, but just in case, we'll add an
- //onFailure method which will let the user know what happened.
- onFailure: function() {
- $('result').set('text', 'The request failed.');
- }
- });
- $('makeRequest').addEvent('click', function() {
- req.send();
- });
- });
Add Comment
Please, Sign In to add comment