I'm not so good at javasript but yet I started to work on a project which have massive untidy pages. Extjs is being used in all pages. almost %99 percent is the only Ext.Ajax.request() I want to remove extjs from header and only include in thoose really using it (not more than a few). (And slowly recode all pages in prototype) But the problem is there are too many simple Ext.Ajax.request() calls in hundereds of pages. It's nearly impossible to go and change the codes one-by-one. Instead I want to write a function that takes the parameters and uses prototype to do the job; and include in global header right after prototype.js. Another words there will be an Ext.Ajax.request() but it won't be Ext. The idea is ok. But I coul'nt make it working. As I said I'm not good at JS All the request are as: //-------------------------------------------------------- function something(params){ some_functions(); //... Ext.Ajax.request({ url: '/something.php='+something, success: function(result, request) { loadingGif.className='hidden'; somefunctions(params); }, failure: function(result, request) { loadingGif.className='hidden'; Ext.MessageBox.alert('Error',result.responseText); return false; }, timeout: (30*1000) }); some_other_functions(); //... } //---------------------------------------------------------- And My idea is like //----------------------------------------------------------- function request(params){ //get the parameters //reset them for prototype var url = //taken url parameter var ajax = new Ajax.request() //............... //............... //............... //return failure as false else true; } var Ext; Ext.Ajax=null; Ext.Ajax.prototype.request=request;
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---