Subj : Re: question about javascript functions To : netscape.public.mozilla.jseng From : Ludovic Delabre Date : Tue Feb 08 2005 12:21 am Hello! I'm not sure I understand what you want so ... Somethin' like this ? (played with the jsshell) js> function myfun() { return "Original"; } js> function fun1() { return myfun(); } js> fun1() Original js> delete myfun false js> function myfun() { return "NewOne"; } js> fun1() NewOne js> Ludovic. Béatrice Philippe wrote: > Hello ! > > i'm currently trying to replace an old javascript function with a new one in > the global object like this: > 1) i create a new javascript function (say 'myfun') and compile it. > 2) i delete the old property of the name 'myfun' > 3) i add a new property with my new javascript function 'myfun' created and > compile in step 1. > > these steps work well. But when i want to call a function 'fun1' that calls > my new function 'myfun', it seems to be lost. > am i forgetting something ? > > Thank you. > > example: > " function fun1() { > .... > myfun(); //crash ! > return; > } > > function myfun(){ > //this is my new function that replaced the old one with the same name. > }" > > .