1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<script type="text/javascript">
dojo.addOnLoad(function(){
var node = dojo.byId("testLink");
var anim = dojo.fadeOut({
node: "theContent",
duration:700,
onEnd: function(){
dojo.xhrPost({
url: "http://ebelair.fr/test.php",
handleAs: "text",
handle: function(data,args){
if(typeof data == "error"){
console.warn("error!",args);
}else{
// show our response
dojo.byId("theContent").innerHTML = data;
}
}
});
dojo.fadeIn({ node: "theContent", duration:700}).play();
}
});
dojo.connect(node,"onclick",function(e){
e.preventDefault();
anim.play();
});
});
</script> |