Hi all,
so much time since my last post! I’ve been involved into so many interesting projects that I could’t even login.
In the meantime a brand new side project idea is born.. All stats looking at the bleeding edge of the CMS/CMR/Framework panorama that I’ve encountered in the last month. None of them is really well [...]
just like my previous script, but with a neat support for <form> tags.
As previous script did, just add TARGET attribute with the ID of your AJAX target.
window.onload=function(){
Event.observe(document.body, ‘click’, function(event) {
var element = Event.element(event);
if (’A’ == element.tagName){
if ($(element.target) != undefined){
new Ajax.Updater(element.target,element.href,
{method:”post”,evalscripts:true})
Event.stop(event);
}
}
});
formz=document.getElementsByTagName(”form”);
for (i=0;i<formz.length;i++){
if ( formz[i].target!=undefined && formz[i].id!= “”){
el=formz[i].id
tar=formz[i].target
Event.observe(formz[i].id, ’submit’, function(event) {
$(el).request({
onSuccess: function(t) {
$(tar).update(t.responseText);
}
})
});
}
}
}
Yes, whe know, W3C specs garbaged all the nice IFRAMES that fitted so nicely in our pages. Ajax helped a lot but even if you used Prototye or some other ajax flavoured framework there was soo much work to do; each single link needed an event listener, some tweaking and so on.
After messing up with [...]
