I understand how Prototype works with regards to the removal of <script> tags after evaling the results of an Ajax request. However, I was doing some research and am now starting to wonder why the way I declare functions works.
According to the Prototype documentation, you need to declare the function and assign it to a global variable: myFunction = function() {alert('hi');} That makes sense. However, in all of my scenarios, I've declared functions like this: var myFunction = function myFunction() {alert('hi');} and the calls to myFunction work just fine. My question is...why does my way work? According to the Prototype documentation, the local variable myFunction should be thrown away after the eval. Any insight anyone can provide would be appreciated. Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---